Hi !!
-----Original Message-----
From: Jeetandra Mahtani <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, April 12, 1999 10:05 PM
Subject: Login problem...
>Hello,
>I have written a login servlet that takes the input
>from a form ( two fields - username and password )
>and establishes a connection to the database using
>the com.ibm.as400.access.AS400JDBCDriver().
>c =
>java.sql.DriverManager.getConnection("jdbc:as400://xyz;naming=sql;errors=fu
ll;extended
>dynamic=true;date format=iso;package
>ibrary=abc",username,password);
>Now when the username and password are correct, I am
>taken to the next page. If the username and password
>are incorrect, a small applet windows comes up on the
>screen asking to enter the username and password. How
>do I prevent this from happening? If the username and
>password are incorrect, could I catch an exception
>and in that exception redirect the user to the login
>page again?
I don't understand your question.
The " small applet window " is for HTTP autetication (I think ??
It should appiar only if you send as response:
response.setHeader("WWW-Authenticate","Basic realm=\"\"");
response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
I don't know what is happing in your servlet but i would resolve this
problem
like this:
1 option :
make a simple html form:
<form Action=" ......./servlet/loginServlet"
method="post>
<input type="text" name="username" >
<input type="password" name="userpasswd" >
.....
</form>
Than in the login servlet
// get parameters
.............
if(user="abalogh" && passwd="apple")
//do something
else response.sendRedirect("http://
/login.html);
That's all
2. option
use the http authentication
as kindly described by
Nic Ferrier
Tapsell-Ferrier Ltd
http://www.tapsellferrier.co.uk/Servlets/FAQ/authentication.html
Best wishes,
Andras
p.s. Sorry if I missundestood your problem
>Appreciate it for any suggestions/ideas?
>Thanks,
>JGM
>
>
>
>
>
>_________________________________________________________
>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
___________________________________________________________________________
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