Has someone an example of filter to do that ? -----Original Message----- From: David Graham [mailto:[EMAIL PROTECTED]] Sent: 06 February 2003 17:37 To: [EMAIL PROTECTED] Subject: Re: RequestProcessor with test conditions
You should really be doing this with a filter if you can. David >From: Heligon Sandra <[EMAIL PROTECTED]> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> >To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> >Subject: RequestProcessor with test conditions >Date: Thu, 6 Feb 2003 17:20:39 +0100 > > > I have defined a subClass of TilesRequestProcessor in order to > test before each request if the user is authenticated. > > Here is my code > > public boolean processPreprocess(HttpServletRequest request, >HttpServletResponse response) > { > // Get the session object > HttpSession session = request.getSession(); > > // Test if the request is a login request > String path = processPath(request, response); > > if ( !path.equals((String) "/login") ) > { > User user = >(User)session.getAttribute(Constants.s_USER_KEY); > > if ( user != null ) > { > // the user is not authenticated > processForwardConfig(request, response, >moduleConfig.findForwardConfig("login")); > return false; > } > return true; > } > } > > When the user is not authenticated i would like to display error on >the current page and not systematically > forward it to the login page, how is it possible ? > > I can not use _mapping.getInput() function and ActionErrors object >like in the Action class. > > What can I do ? > > Thanks > Sandra > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail --------------------------------------------------------------------- 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]