Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

exception thrown from servlet function  RSS feed

 
Chak Terlapu
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a servlet "main.java" which connects to a database and displays a table. The table contains a check box in front of each table row. It has three buttons at the bottom "add" modify" "delete". When the user clicks on some check boxes and clicks on "delete" button how can i know in the script delete.java that these are the check boxes that have been checked or selected. I tried to do in the following way
String[] checkedBoxes = new String[100];
checkedBoxes = req.getParameterValues("sel");
where sel is the name of the checkboxes
but I am getting the following error:
[21/Aug/2001:10:36:54] failure ( 1118): Internal error: exception thrown from the servlet service function (uri=/servlet/delete.class):java.lang.NullPointerException, Stack: java.lang.NullPointerException
Any help would be appreciated.
Thanks
Chak
 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check boxes only come back in the request if they are selected. If you query a parameter value and it wasn't sent, you get a null value.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!