This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes Request not fetching all Parameters. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Request not fetching all Parameters." Watch "Request not fetching all Parameters." New topic
Author

Request not fetching all Parameters.

Jack Numen
Ranch Hand

Joined: Nov 09, 2011
Posts: 42

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

Joined: Jan 10, 2002
Posts: 60810
    
  65

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
Make sure you do not have any HttpServletRequestWrapper implementation that is decorating these methods.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 980
    
    2

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

Joined: Nov 09, 2011
Posts: 42

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

Joined: Jan 10, 2002
Posts: 60810
    
  65

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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request not fetching all Parameters.
 
Similar Threads
enctype="multipart/form-data" request.getParameter() issue
problems adding new parameters to a request
getting parameter names from form
passing hidden field in jsp
Problem with default '' , 0 and 0.0 being inserted into database while using JSTL.