Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Request: getParameterNames returns nothing

843841Jul 19 2005
Okay this is vexing me.

I have Tomcat 4.18 running through apache on a box.

I create a simple URL x.jsp?a=&b=2&c=3

And print out the parameters and the values.
At will at some point it prints out nothing as reqeust.getParameterNames() is empty.

Never own it's own, that is I run the code that prints out the parameters over & over it alwas work, only after running my site on the same server does it fail and then only a couple times. This does not happen on other boxes.

So why would request.getParameterNames() get an empty Enumeration? Any guesses? Appears something I do causes this... but stuck as what that could be.

Here is the simple JSP I wrote that show spit on the paramters passed along. I would post my web site code but it's 100s of programs tied together.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page import="java.util.*"%>
<%@ page import="javax.servlet.http.*"%>

<%

out.println(session);
out.println("<br>");
out.println(request);
out.println("<br>");
out.println(pageContext);
out.println("<br>Length: ");
out.println(request.getContentLength());
out.println("<table><tr><th colspan=2>Req</th></tr><tr><th>Name</th><th>Value</th></tr>");
for (Enumeration e = request.getParameterNames(); e.hasMoreElements();) {
String x = (String)e.nextElement();
String y = (String)request.getParameter(x);
out.println("<tr><td>");
out.println(x);
out.println("</td><td>");
out.println(y);
out.println("</tr>");
}
out.println("</table>");

%>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 16 2005
Added on Jul 19 2005
0 comments
192 views