A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
getting null pointer exeception
Joined: Nov 06, 2001
Apr 11, 2002 09:47:00
I am geeting Null pointer exception if any of the fields which I am selecting in
HOw to deal with NULL values in JSP code.
I am using mysql database.
Author and ninkuma
Joined: Jan 10, 2002
Apr 11, 2002 12:56:00
The same way you would deal with them in any other Java code.
before you use the reference.
String xyz = request.getParameter( "whatever" ); if (xyz != null) xyz.trim();
A useful idiom in JSP:
String xyz = request.getParameter( "whatever" ); if (xyz == null) xyz = " "
Another, to safely compare strings when the parameter might be null:
if ("xyz".equals( request.getParameter( "whatever" )) ...
[ April 11, 2002: Message edited by: Bear Bibeault ]
Asking smart questions
Books by Bear
Don't get me started about those stupid
subject: getting null pointer exeception
null pointer exception
Question on Boxing
getting this error PLS-00103: please help
null pointer exceptiion
request.getAttribute returning null
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013