This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes exception thrown from servlet function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "exception thrown from servlet function" Watch "exception thrown from servlet function" New topic

exception thrown from servlet function

Chak Terlapu
Ranch Hand

Joined: Oct 20, 2000
Posts: 32
I have a servlet "" 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 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.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964

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.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: exception thrown from servlet function
Similar Threads
req.getParameterValues returning null
Capturing selected check boxes
multibox functionality in struts
check boxes functionality in struts
How to trace selected CheckedBoxes in different forms using a Single Servlet