File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Head First Android
this week in the
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
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
I agree. Here's the link:
subject: getting null pointer exeception
Question on Boxing
getting this error PLS-00103: please help
request.getAttribute returning null
null pointer exception
null pointer exceptiion
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015