I think you are better off comparing
if(pQ2 == null) to check for a null ;
:-)
"Lambert, Stephen : CO IR" wrote:
> I'm trying to pass blanks for a null into my db from an html form.
> Code as follows:
>
> String pQ2 = request.getParameter("check2");
> if (pQ2.equals("null") {pQ2="";
> }
>
> I end up with the error "java.lang.NullPointerException".
> Even though when I display the variable pQ2, it gives me "null"(no quotes)
> using:
>
> out.println(pQ2);
>
> Anybody know how to check for null data from a doPost method?
> Thanks,
> Stephen.
>
> ___________________________________________________________________________
> 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
begin:vcard
n:Asthana;Rishi
tel;fax:1-732-548-4009
tel;home:1-732-635-3597
tel;work:1-732-548-0087
x-mozilla-html:FALSE
org:NetCom Systems, Inc;Software Development
adr:;;116,Copperfield Ln ;Metuchen;NJ;08840;USA
version:2.1
email;internet:[EMAIL PROTECTED]
title:Systems Consultant
x-mozilla-cpt:;-3936
fn:Rishi Asthana
end:vcard