Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Request not fetching all Parameters.

 
Jack Numen
Ranch Hand
Posts: 42
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a registration Page and all the fields are submitted to the same page using the action attribute of the form tag.
Instead of getting each and every input variable using request.getParameter(parameterName) i am usign request.getParameterNames() and from these name i am getting the Values.

My problem is there are nearly 75 fields in the form submission which have to be fetched by the request Object(JSP - Implicit) out of which one or two fields are not being fetched in request.getParameterNames().

I checked the following before posting/asking here
1.Whether the form tag is properly closed .
2.Whether the parameter which is being omitted can be fetched using request.getParameter().

These cases are successful i mean the form is ended properly and request.getParamter() fetches the value where as it is not shown in request.getParameterNames.

Can anyone help me find out why some paramters which are filled are not being included in the request.getParameterValues Object inspite of them beingi n request.getParamter()


Thanks and Regards
Jack Numen
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, of course, be sure to submit to a servlet, not a JSP. JSP is a view technology that is often misused to process data. And modern JSPa should have no Java code in them.

That said, the first thing I would do is to use a tool such as HttpFox to see the body of the request itself and check if the values are being submitted. If the values are in the request, you'll know that the problem is on the receiving side. If not, then you'll know it's on the sending side.
 
Piyush Mangal
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you do not have any HttpServletRequestWrapper implementation that is decorating these methods.
 
Punit Jain
Ranch Hand
Posts: 1012
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the first thing I would do is to use a tool such as HttpFox to see the body of the request itself and check if the values are being submitted.

going to search for how to use it.
thank you Bear Bibeault.
 
Jack Numen
Ranch Hand
Posts: 42
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Firstly, of course, be sure to submit to a servlet, not a JSP.

Bear,
If i would have the provision of servlets i would definetly go for it. Here is the scenario in which we are compromising MVC.
We regularly have updates from the client sometimes on a daily basis and sometimes weekly so we have to write our code in JSP so that there is no need to restart the server everytime we make an update.


That said, the first thing I would do is to use a tool such as HttpFox to see the body of the request itself and check if the values are being submitted.

In my workplace i cannot use tools other than provided.

So i would like to know if there are any limitations in request.getParameterNames() method .Limitations in the sense i mean request object can fetch only 20-50 parameters in Best case scenario and omitting 1 or 2 parameters in the worst case scenario etc.

Thanks,
Jack
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no limit on the number of parameters.

What there is a limit on is the length of a URL. Is the submission a GET rather than a POST?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic