• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with request.getParameterValues

 
sree lekha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Iam trying to pass two values through url.

String url="SalesByPaymodeMontly?paydate="+paydate+"&"+" paydate1="+paydate1;

In my SalesByPaymodeMontly Servlet,I couldn't access the second parameter passed in the url.It gives me a null pointer exception.

Any one please let me know how to use request.getparameterValues or any other way to access the second parameter.

Any sample code will help

Regards
Sreelekha
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or any other way to access the second parameter

request.getParameter("paydate1");

And remove the space you seem to have before paydate1 in your url.
 
sree lekha
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey thanks a lot , It worked...
 
Mallik Avula
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
request.getParameterValues() method is for getting the array of values of an argument. For example if you have a list box where the user can make more than one like two or three, then we will use getParameterValues() method.
Come to your problem i think it is because of space problem.Remove that one.
then you can get using getParameter() method with the argument name.
hope i gave the needful
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!