struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Laurie Harper <lau...@holoweb.net>
Subject Re: Newbie to Struts 2 - Question about Interceptors
Date Fri, 01 Feb 2008 17:09:08 GMT
daveck wrote:
> Hello,
> I need to put up a "Confirmation Screen" in between my input jsp and my
> success jsp.
> 
> byproduct.action -> byproduct-input.jsp
> byproduct-input.jsp -> confirm.jsp
> (If yes...)
> confirm.jsp -> byproduct.action
> byproduct.action -> byproduct-success.action
> 
> Is there a Struts 2 way to carry the input parameters across the confirm.jsp
> so the second call to byproduct.action has access to them?
> 
> I've looked at the ChainInterceptor and ActionChaining and have a feeling
> the solution resides there, but could use a little help.  I hope I was clear
> enough... :)
> 
> Thanks!

The short answer is no, not without intervention from you. You will need 
to arrange yourself for the data submitted from byproduct-input.jsp to 
be carried over so that it's available to byproduct.action.

Two ways to do that are:

1) place an action between byproduct-input.jsp and confirm.jsp which 
saves the submitted data into an object stored in the session, then 
retrieve that object in byproduct-success.action

2) place hidden fields in confirm.jsp that correspond to the inputs in 
byproduct-input.jsp, populating them from the request parameters. Make 
sure that confirm.jsp calls byproduct.action using a form submit (not 
just a link) so that the data in the hidden inputs gets sent.

You should probably be submitting byproduct-input.jsp to an action 
anyway, so that you can perform validation and/or expose any additional 
data that confirm.jsp might need but, other than that, the main thing 
affecting which approach you choose is whether you want to use or avoid 
the session.

HTH,

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message