File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes getting null pointer exeception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "getting null pointer exeception" Watch "getting null pointer exeception" New topic
Author

getting null pointer exeception

padma patil
Ranch Hand

Joined: Nov 06, 2001
Posts: 41
I am geeting Null pointer exception if any of the fields which I am selecting in JSP are NULL.
HOw to deal with NULL values in JSP code.
I am using mysql database.
thanks,
padmashree
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61760
    
  67

The same way you would deal with them in any other Java code. Test before you use the reference.
For example:

A useful idiom in JSP:

Another, to safely compare strings when the parameter might be null:

hth,
bear
[ April 11, 2002: Message edited by: Bear Bibeault ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting null pointer exeception