1. I would make the Login servlet read in the login.html file in it's init
and if the validation fails, send out the contents of the login.html file
that have been read in.
2. In my class hierarchy, I have my super-most class catch all exceptions,
this same class always authenticates each request by accessing an object in
the Session. If the accessing of that object fails, I throw a
"NoSessionException" which is caught by another part of the class. This way
I know to display (or redirect in your case) a link back to the login page.
-----Original Message-----
From: Louis Mechery [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 26, 1999 3:55 PM
To: [EMAIL PROTECTED]
Subject: Better way to call SERVLETS/html
Hi All,
I am thankful all of you who responded to my previous e-mails. I know many
of you are servlet gurus. My question is:
Question1:
==================
I am using a login.html (includes java script) that accepts user_id and
password from user. This login.html calls a servlet (using <FORM method=post
action="/servlet/Login">) in order to validate user_id/password against
database. If INVALID userid, then I want to display the same login.html
directly. I tried using <a href="/html/Login.html">Invalid User Id</a>. But
this method is inefficient because the User has to click on this link.
Question:2
==================
If valid userid, then I call another servlet "Menu" which has all the menu
items. Let's say "Employee Search" link ("/servlet/EmployeeSearch").
When the user clicks on this link, "EmployeeSearch" servlet is called.
if the session was timedout, then redirect to Login.html servlet.
How can I do this? Please reply.
Thanks in advance.
Louis Mechery
___________________________________________________________________________
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