I was not doing that, but it's a good strategy that I just implemented.
That was not the problem, however. I do not know why, but trying to set the
session attribute for <minit> (middle initial) when <minit> is null caused
the NullPointerException whenever attempting to get the <userID> or
<password> attribute, but not the <fname> or <lname> attribute. It's
working now that I tested for null in the ResultSet as well as before
setting the attribute:
String minit = null;
if( rs.getString( "minit") != null) {
minit = rs.getString( "minit");
}
if( minit != null) {
session.setAttribute( "minit", minit);
}
Very strange...I would think that the second test would suffice. It's no
accident it's called the "art" of computer programming!
Thanks for everyone's help.
Mark
----- Original Message -----
From: "Rohan Shrinivas Desai" <[EMAIL PROTECTED]>
Sent: Friday, December 28, 2001 8:30 AM
> are you sure that the session object is created ???
> how r u instaintiating the session ??
> preferrably do this..
>
> if you have the response and request objects then,
>
>
> HttpSession session = request.getSession(true);
> if(session==null)
> {
> response.sendRedirect("/Error.html");
> }
> this way you can be sure that session object is created
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html