This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getParameterValues  RSS feed

 
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
Boost this thread!