Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic