Bear Bibeault wrote:It's always easy to think that something has happened. But the exception proves otherwise. Put the checking code into the servlet and see where things go from there.
But you haven't answered the question, what do you want to happen when a null value is detected?
Bear Bibeault wrote:Well, what are you going to do about it? Why did you remove the checking? It's an important part of the process.
Bear Bibeault wrote:There's no such statement in your posted code.
Also, you need to do more than just print something out. What do you really want the servlet to do if the value is null? It's always a real possibility that your code must be able to handle.
Bear Bibeault wrote:
Larry Lee wrote:however i checked that the string that i`m initialising it with contains a value.
I see no evidence of code that does this checking.
Paul Clapham wrote:Then your pk2 variable is null.
Here's where you assign a value to it:
but if there's no "publicK" parameter in the request then null is assigned to the variable. You'll want to put in some code which checks for that.
Also, there's no point in calling the toString() method of a String variable. Just use the variable itself.
Bear Bibeault wrote:SEVERE: Servlet.service() for servlet [DHServlet] in context with path [/MyServletProject] threw exception
Which line is 165?