My mistake, there's an easier way to use change the default ActionMapping class to use, set the type on the <action-mappings>
<action-mapping type="myPackage.MyActionMapping"> <action path=/myLogin"....> <set-property property="sessionCheck" value="false"/> </action> Niall ----- Original Message ----- From: "Niall Pemberton" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Saturday, April 10, 2004 12:08 PM Subject: Re: Question about throwing an exception in the ValidatorForm validate method. > No, you can only specify a RequestProcessor for different modules. > > You could put something in your struts-config.xml to indicate to the > RequestProcessor that it shouldn't check the session for a particular > mapping. The only thing is the processPreprocess() method is done before the > mapping is determined, so probably need to override the processMapping() or > processValidate() methods instead. > > Simplest way to do this would be to set the parameter attribute to some > value: > > <action path=/myLogin" parameter="dontCheckMySession" ....> > > Then in the RequestProcessor you can use mapping.getParameter() to retrieve > and check the parameter. > > Alternatively you could implement your own sub-class of ActionMapping which > takes a bit more - you would need to implement your own ModuleConfigFactory > which does something like this: > > public ModuleConfig createModuleConfig(String prefix) { > ModuleConfig config = new ModuleConfigImpl(prefix); > config.setActionMappingClass("myPackage.MyActionMapping"); > return config; > } > > I think from the next version of struts you will be able to set a > "configFactory" parameter in the web.xml - but for Struts 1.1 the only way I > know to use this is to set up a ServletContextListener which calls the > static setFactoryClass() method in ModuleConfig. > > Anyway then you sub class ActionMapping, add some property of your own and > then in struts-config.xml.. > > <action path=/myLogin"....> > <set-property property="sessionCheck" value="false"/> > </action> > > Niall > > ----- Original Message ----- > From: "Stephan Jones" <[EMAIL PROTECTED]> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]> > Sent: Friday, April 09, 2004 8:45 PM > Subject: RE: Question about throwing an exception in the ValidatorForm > validate method. > > > > The RequestProcessor processPreprocess(request, response) method seems > the > > best but > > I'm not sure how to override it for my first login page where the valid > > session is not set up yet. > > Can I give a specific requestProcessor for an individual action mapping? > > > > Thanks for the first response Niall. > > > > ----Original Message----- > > From: Niall Pemberton [mailto:[EMAIL PROTECTED] > > Sent: April 9, 2004 11:43 AM > > To: Struts Users Mailing List > > Subject: Re: Question about throwing an exception in the ValidatorForm > > validate method. > > > > Do you want to do this on a form by form basis or for all forms? > > > > If you want to do it for all forms then you could either customise > > RequestProcessor (maybe in the processPreprocess(request, response) > method) > > or use a Filter. > > > > If you need to do it on a form by form basis, then why not skip validation > > if its expired and let the Action check your session and throw the > > Exception. > > > > Niall > > > > > > ----- Original Message ----- > > From: "Stephan Jones" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Friday, April 09, 2004 7:06 PM > > Subject: Question about throwing an exception in the ValidatorForm > validate > > method. > > > > > > > I have a problem I need advice solving. > > > > > > The Validate method does not allow me to check if the session has > expired > > > and throw a suitable exception. > > > I have the possible scenario where a user calls up a page. Leaves it > idle > > > long enough to expire the session. Then hits the update button. > > > > > > What happens is the validate method is called and the record is > validated. > > > Since the session has timed out when the input page with an error is > > > presented some of the values on my page, (like the current logged in > user) > > > are no longer available. > > > > > > Ideally I would like to check the session in the validate method, throw > my > > > usual SessionExpiredException if the session is blank but the validate > > > method does not allow me to override the ValidatorForm validate method. > > > > > > Any advice on how to elegantly solve this? > > > > > > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > 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] > > > > > > > > > > --------------------------------------------------------------------- > 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]