Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getParameter weirdness

Status
Not open for further replies.

MrTom

Programmer
Mar 13, 2001
383
GB
all i wanted to do was add some debug parameters to my servlet and now i'm totally confused!!!

if (req.getParameter("debug").equals("y"))
{
out.println("hello");
}

if the parameter is not set at all then i get a nullpointer exception *sometimes*. i say sometimes as i was using it at near the bottom of my doGet method fine but when i moved it up a bit i ran in to these problems.

am i supposed to catch any null pointer exception every time? if this is the case then i will live with it, but why did it work ok before??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top