• Post Reply Bookmark Topic Watch Topic
  • New Topic

getParameterValues

 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to get a String arr[] with parameter values passed from a hyperlink url:
Contents of a href hyperlink are:

="http://localhost:8080/FirstProject/SecondServlet.do?cars=esteem,maruti,range rover"

but in my doGet()
{
String arr[]=new String[4];
arr=request.getParameterValues("cars");
//On printing the arr[] values it gives me ArrayIndexOutOfBoundsException :1
}

Why is it so ? what is my mistake?
 
vani venkat
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi amarkrit
can you please try this
String arr[] = request.getParameterValues("cars");
instead of
 
Whatever. Here's a tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!