What is the objective of your session management?
If it's simply access-control then you should use the containers
features, like resource-collections and that like which is
described in the security chapter of servlet spec.
Peter
----- Original Message -----
From: Sudhanshu Rawat <[EMAIL PROTECTED]>
Date: Monday, November 26, 2001 12:09 pm
Subject: Session Management in JSP Application
> Hi All , I have a simple JSP application wherein I have all pages are
> displayed using JSP's and all business logic is contained in Java
> Beans. In
> order to manage sessions in this application, I am including the
> followingpiece of code in every JSP page :-
>
> <%@ page session = "false"%>
>
> <%
> HttpSession session = request.getSession(false);
> if(session == null){
> response.sendRedirect("login.jsp?message=NoSession");
> return;
> }
> %>
> This seems to be working fine. But problem arises when I try to
> use a bean
> with session scope, wherein an Exception is thrown, since we are
> trying to
> use a session scope in a page with session set to false. A work
> around could
> be to have the session directive as true , add some variable to
> the session
> when it is first created, and then subsequently check for this
> variable in
> every page.
> I would like to know :
> 1) Is the above work around correct and robust enough?
> 2) Is there a better approach for managing sessions in such an
> application?
> Thanks
>
> Sudhanshu
>
>
________________________________________________________________________
___
> To unsubscribe, send email to [EMAIL PROTECTED] and include in
> the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http:
> Resources: http://java.sun.com/products/servlet/external-
> resources.htmlLISTSERV 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