Harish,

pwsd would be null only if there is no "PASSWORD" HTML field in the page
that you're submitting. What you need to check is the contents of pwsd. You
may check pwsd.equals("") or something on the same lines.

BTW, I think this sort of validation shd be done using Javascript on the
client side.

jacs


-----Original Message-----
From: Harish Satyanarayanrao [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 13, 2000 8:08 AM
To: [EMAIL PROTECTED]
Subject: checking for null password


Hi,

I have a problem in a servlet which i wrote.

The servlet accepts a username and password from a HTML form.

I am accessing the same using getParameter function in the doGet function.

String pwsd = request.getParamater("PASSWORD");

To check if the user pressed the submit button without entering the
password,
I tried
if (pswd==null) {//show the login page again with a error message}

The program does not enter this if loop .
(The string pswd is getting assigned a value if i do enter the password in
the
HTML form)

Am i missing something?

Harish


____________________________________________________________________
Get free email and a permanent address at http://www.netaddress.com/?N=1

___________________________________________________________________________
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

___________________________________________________________________________
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