• Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp error

 
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!