This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
    Bookmark Topic Watch Topic
  • New Topic

Enumeration is not returning any data

 
Steve Dyke
Ranch Hand
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Steve Dyke
Ranch Hand
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator

Why have you used enctype="multipart/form-data" ?? There's no file upload box in your form...
 
Steve Dyke
Ranch Hand
Posts: 1616
1
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Report post to moderator
Lets continue the discussion about the double submit in this topic...
 
    Bookmark Topic Watch Topic
  • New Topic