________________________________ From: Burton Rhodes <burtonrho...@gmail.com> Sent: Tuesday, April 17, 2018 7:23 AM To: Struts Users Mailing List Subject: Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?
That's a great thought. I think the session method makes more sense. On Tue, Apr 17, 2018 at 2:12 AM, Yasser Zamani <yasserzam...@apache.org> wrote: > > > On 4/17/2018 6:42 AM, Burton Rhodes wrote: > > Also, How would I include everything except the email body field with the > > s:url tag? > > Unfortunately, I couldn't find a simple way :( > > However, as a workaround, instead, in your email form jsp, could you put > the email body field as a POST param and the rest short fields which > need validation as GET params (i.e. in a query string inside action url > using s:url)? Because then you can use <meta http-equiv="refresh" > content="3;url=<s:url includeParams="get"/>"/> which only counts GET > params i.e. only query string which doesn't include email body but > includes other validation needed fields. > > But if I were you, I prefer to use two actions for such requirement. > action1 which doesn't have ExecAndWait interceptor but has others like > validation, gets form data and stores them as a single object inside > session with a unique key every-time i.e. a GUID. Then action1 redirects > to action2 and also passes that key to action2. action2 behaves like a > mail sender and only has ExecAndWait interceptor. action2 gets then > deletes data from session by that key and the rest is same as your > current single action :) MG>AFAIK a redirect terminates the old session and creates a new session MG>a better alternative is to implement ChainingInterceptor with <result type="chain"> e.g. MG> <action name="someAction" class="com.examples.SomeAction"> <interceptor-ref name="basicStack"/> <result name="success" type="chain">otherAction</result> </action> <action name="otherAction" class="com.examples.OtherAction"> <interceptor-ref name="chain"/> <interceptor-ref name="basicStack"/> <result name="success">good_result.ftl</result> </action> MG> http://viralpatel.net/blogs/struts-2-action-chaining-example/ Struts 2 Action Chaining example - ViralPatel.net<http://viralpatel.net/blogs/struts-2-action-chaining-example/> viralpatel.net In Struts 2, sometimes you may want to process another action when one action completes. For example on successfully submitting a form you want to render output from other action. MG>? > > Regards. >