Hi Andrey,
Write a separate LoginServlet wich puts within HttpSession some value
that marks the user has already logged in :
String currentUserId = // LoginServlet's job to find it..
mySession.putValue("LoggedUserId", currentUserId);
In all other servlets, you need to check only if
mysession.getValue("LoggedUserId"); returns a non null value.
If this call is null just call
response.sendRedirect("/servlets/LoginServlet") or what ever your
login servlet is named.
Another approach is to use http-server based authentication on all
requests beginning with "/servlet/" prefix. Then no user will get
access to any of your servlets before is authenticated.
Cezar
On Fri, 26 Mar 1999, Andrey Sazonov wrote:
> Hi all!
>
> I have following design problem and I hope anybody can help me.I need to
> develop web based
> access to the database. Every user who try to work with this system need to
> log in before real access
> to database. It works fine with session tracking mechanism (access to
> database provided by set
> of appropriate servlets and beans).
> But problem occurs when the user bookmarked some page and the tries to come
> directly to bookmarked page.
> Does anybody know the way how to prevent this and show login page instead
> bookmarked one?
>
> I think this could be implemented by processing of all request to whole site
> by one servlet, which will
> further dispatch all requests, but I'm afraid this could apply additional
> bottleneck to system.
>
> ---------------------------
> Sincerely
> Andrey Sazonov
> ([EMAIL PROTECTED])
>
> ___________________________________________________________________________
> 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
>
Cezar Totth email: [EMAIL PROTECTED]
Fax: (401) 220 33 95
Genesys Software Romania Phone: (401) 638 49 44
Stefan Furtuna 169, sect.6
cod 77171, Bucharest
Romania
___________________________________________________________________________
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