Laurie: I alyways use a redirect after a form post to avoid the stupid page expired warning if the user hits the reload button.
I think we will save the ActionSupport instance in the session and get it back from there. Thanks, Neil -- Neil Aggarwal, (214)986-3533, www.JAMMConsulting.com FREE! Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details. -----Original Message----- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper Sent: Friday, April 06, 2007 5:30 PM To: user@struts.apache.org Subject: Re: [Struts2] How to get instance of ActionSupport class after redirect? Neil Aggarwal wrote: > Hello: > > I have this scenario: > > I have a form in a jsp file that submits to an > ActionSupport class. > > The ActionSupport class captures the submitted > data and validates the input. If the data is valid, > it sends the user back a redirect to a servlet url > to give them the data file generated for their > input (It is a CSV file). My first suggestion would be to get rid of the redirect to a separate servlet and serve the CSV response directly from the action. Is there a reason you can't do that? There's no way your servlet can get the action class instance, since action instances are request scoped; the instance no longer exists in the new request the servlet receives. Your options in this case (or any other case where you want to use data from one request in a subsequent request) are pretty much limited to either including the data in the redirect URL's query parameters, as you are doing, storing them in the user's session, as you suggested, or persisting them somewhere else, such as a database. L. --------------------------------------------------------------------- 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]