tags:

views:

54

answers:

2

Hi guys,

I have a problem with a JSP file. I want to retrieve the header but I have an error:

Une erreur s'est produite à la ligne: 45 dans le fichier jsp: /logTest.jsp
Enumeration cannot be resolved to a type
42: String headerString = "";
43: String name = "";
44: 
45: for (Enumeration en = request.getHeaderNames(); en.hasMoreElements(); ) {
46:     name = (String)en.nextElement();
47:     headerString = headerString + name + "=<B>" + request.getHeader(name) + "</B><BR>";
48: }

My object (request) is not null so I don't understand why I have this error.

Can you help me ?

Thanks.

+5  A: 

You have to explicitly import java.util.Enumeration. The stack trace gave you the answer: "Enumeration cannot be resolved to a type".

Jonathan Feinberg
A: 

Ok thanks, it was it ;)

Kiva