Hello all. I have an email servlet which processes a form. I use an
Enumeration to get the parameter names, the values of which I then put into
a hashtable (don't ask). When I get the values out again to output, I find I
have to use a second Enumeration to get the parameter names. If I don't,
nothing is retrieved from my hastable. Does the Enumeration object "empty"
as the elements in it are retrieved? Thanks so much.
Enumeration enum = request.getParameterNames();
Enumeration enum2 = request.getParameterNames();
//we'll store the submitted parameters here
Hashtable hash = new Hashtable();
<snip>
while(enum.hasMoreElements())
{
String name = (String)enum.nextElement();
String value = request.getParameter(name);
hash.put(name, value);
System.out.println(hash.get(name));
}
<snip>
while (enum2.hasMoreElements())
{
String name = (String)enum2.nextElement();
System.out.println((String)hash.get(name));
msg.println(name + ": " + (String)hash.get(name));
}
D Lampon
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html