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

jsp error  RSS feed

 
kishani liyanage
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me i get this error when compiling the jsp

Incompatible type for declaration. Can't convert java.lang.String to java.lang.String[].
java.lang.String[] selectedItems = request.getParameter("ItemID");
^
 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello kishani liyanage ,
request.getParameter() returns String and not String []. If you want String[] than you should call request.getParameterValues(). That i:
String[] selectedItems = request.getParameterValues("ItemID");
OR
String selectedItems = request.getParameter("ItemID");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!