Hi all,
    I am implementing sessions using a Java bean which has fns to put values
(sync), get values, check if the user has logged in, do login etc. I am
using this bean in all the servlets(requiring authentication) for an
application by instantiating the bean and calling its fns. Basically the
flow is something like this :

    Request-->ApplicationManager-->if logn not
done--->LoginHandler--->Originalrequest.

    Request-->ApplicationManager-->if logn done--->Requested servlet.

    In each of these servlets, I am doing a :
        SessionBean aBean = new SessionBean.

    This is not feeling quite right. Is there a way to make this object
global to this application (i.e instantiate only once if not already done
and then in other servlets simply use its handle)? I have the bean currently
in a subdirectory under /servlets.

NOTE : The bean object itself can be put in the session and the other
servlets would simply check if the object is there or not. But i am not
sure....

    On the other hand, would it be a better design if I have a class derived
from HttpServlet doing the session logic and then make all the servlet
classes derive from this class? This class can be put in a package under the
/servlets directory or probably in a server-classpath directory.

Any help wuld be appreciated.

thanks.
Raaj.

___________________________________________________________________________
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