File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Enumeration is not returning any data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic
Author

Enumeration is not returning any data

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
From the following JSP:



Calls this servlet:


My Servlet is called but it only returns the output string here at servlet. How do I read the values of the parameters on the form?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17

My Servlet is called but it only returns the output string here at servlet. How do I read the values of the parameters on the form?

The question is not very clear to me, but getParameterNames as the name suggests, returns parameter names not values. If you want the values, you'll have to get the parameter values while iterating over the enumeration i.e.


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
Ankit Garg wrote:
My Servlet is called but it only returns the output string here at servlet. How do I read the values of the parameters on the form?

The question is not very clear to me, but getParameterNames as the name suggests, returns parameter names not values. If you want the values, you'll have to get the parameter values while iterating over the enumeration i.e.


My post got slightly ahead if itself. I do want the values but I have not got it to return the parameters yet.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17


Why have you used enctype="multipart/form-data" ?? There's no file upload box in your form...
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1466
    
    1
Ankit Garg wrote:
Why have you used enctype="multipart/form-data" ?? There's no file upload box in your form...


I have taken that out. I have gotten this to work now however, I am getting a double hit on the servlet(two calls) from my JSP.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9304
    
  17

Lets continue the discussion about the double submit in this topic...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Enumeration is not returning any data