this type of processing is better placed in the controller.  i would suggest
either subclassing ActionServlet or providing a generic base class for each of
your Action classes which performs a check similar to:

HttpSession session = request.getSession();

if(session == null) {
  mapping.findForward("welcome");
}

this way the logic is in one place and always checked on each request.

Xavier Brunel wrote:

> Hi all,
>
> I am using Struts for an Intranet application (Linux,Sybase,Java) and it is
> working very well.
> The last thing I would like to do is forwarding automatically the current
> client to the welcome page when his session is timeout, through a call to a
> particular ActionForward of struts-config.xml
>
> I built a JSP page (index.jsp) who calls the correct forward :
> ----------------------------------------------------------------
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
> <logic:forward name="welcome"/>
> ----------------------------------------------------------------
> I have the correct struts-config.xml structure (when i call the jsp directly
> i actually go to the welcome page who is a template).
> -------------------------------------------------------------
> <global-forwards>
>         <forward name="welcome"  path="/jsp/t-welcome.jsp"/>
> </global-forwards>
> -------------------------------------------------------------
>
> But I have one last problem :
> I would like to know how to catch the session time out event, in order to
> call the index.jsp page.
> As anybody an idea about this ???
>
> Xavier


Reply via email to