People have suggested servlet filter is a good choice to check session time-out that if I want all servlets and JSPs remain intact.
I do not have any idea how it works in Struts. First of all, I think this servlet filter has to be declared in the web.xml. I have many actions in the struts application. How do I call this servlet filter whenever the flow goes to an action? Do I code HttpSession session = request.getSession( false ); if ( session != null) { session.removeAttribut( ... ); session.invalidate(); } in the doFilter(); ? --- "Seyhan BASMACI (Internet Yazilimlari Yetkilisi)" <[EMAIL PROTECTED]> wrote: > > try this :) > > > public class SessionRequestProcessor extends > TilesRequestProcessor{ > protected String processPath(HttpServletRequest > request, > > HttpServletResponse response) > throws IOException > { > > String origPath = request.getRequestURI(); > > if(!origPath.endsWith("/Login.do")){ > > HttpSession session = > request.getSession(false); // get session only if > it exists > > > if (session != null ) { // session > available, > > return super.processPath(request, > response); > > } > > else // redirect to login > page > > return "/Login"; // returns without .do > } > > else { > > HttpSession session = > request.getSession(false); // get session only if > it exists > > if (session != null) > session.invalidate(); > > return super.processPath(request, response); > // process login page request > > } > > } > > > > -----Original Message----- > From: Samanth Athrey > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 05, 2003 5:26 PM > To: [EMAIL PROTECTED] > Subject: Handling Session Timeout > > > Hello Gurus > > I am trying to handle session timeout by extending > RequestProcessor. Since > the processPreprocess(...) method is called before > the Action.execute(..) > method, am trying to add that piece of code to check > if the session is > valid. The problem am facing is, if i return false > from this method, the > requestProcessor will stop processing and return the > control back to doGet > or doPost method in ActionServlet. How do I redirect > it to login.jsp or > index.jsp from there? Any help/tips would be really > great. > > Thanx. > Sam > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]