hi Mark ,
u have given a good way to handle the problem but not the solution to it.
Actually it really surprises me when some one says , a prob is accruing only
sometimes.
Mike check our for any spaces that u might be giving after the "=" sign.
TARUN
----- Original Message -----
From: "Galbreath, Mark" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 08, 2002 10:20 PM
Subject: Re: Getting a Null Pointer Exception from a getParameter ... but
only sometimes


> Test the value of url as null and length as in
>
> try {
>     if( request.getParameter( url) != null
>         && request.getParameter( url).length > 1) {
>
>         [do all your stuff]
>
>     } else { [log an error] }
> } catch()
>
> Mark
>
> -----Original Message-----
> From: Mike Dizon [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 08, 2002 10:48 AM
>
> I'm having problems with a servlet that I have written. The problem occurs
> only SOMETIMES! , and I can't figure out why it works sometimes, and other
> times not. The getParameter is taking in a string representation of a URL
> based on input from the browser input. Such as
> http://localhost/servlet?url=http://anotherwebsite.com
> It works most of the time, but on some websites I get the Null Pointer
> exception, and sometimes I try again and it works. Also, I did a
> System.out.println(url) and it prints out as Null when I get the Null
> Pointer.
>
>
___________________________________________________________________________
> 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


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


___________________________________________________________________________
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

Reply via email to