Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-17 Thread Martin Gainty



From: Burton Rhodes 
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 
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  content="3;url="/> 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  e.g.
MG>

 
 otherAction
 

 
 
 
 good_result.ftl
 
MG>
http://viralpatel.net/blogs/struts-2-action-chaining-example/
Struts 2 Action Chaining example - 
ViralPatel.net
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.
>


Re: Struts2 login action class seems to be reused

2018-04-17 Thread Yasser Zamani


On 4/16/2018 7:19 PM, Prasanth Pasala wrote:
> So I am wondering where did these values come from into the instance 
> variables?

Great! Please also get the current stack trace inside your action's
setUsername method and save it in a private string field inside your
action. Then when action and request data mismatched, also print this
string which answers where did these values come from.

Thanks in advance!

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


Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-17 Thread Yasser Zamani


On 4/17/2018 3:53 PM, Burton Rhodes wrote:
> That's a great thought.  I think the session method makes more sense.

Glad to hear :) thanks! I would like to add that you also can delete
ExecAndWait interceptor. Then just save posted data in db and
immediately send a thank you message to your user. Then check for and
send emails (e.g. each 10 minutes) e.g. using quartz jar.

Regards.


Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-17 Thread Burton Rhodes
That's a great thought.  I think the session method makes more sense.

On Tue, Apr 17, 2018 at 2:12 AM, Yasser Zamani 
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  content="3;url="/> 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 :)
>
> Regards.
>


Re: [S2] ExecuteAndWait Interceptor // Only re-submit token parameters on refresh?

2018-04-17 Thread Yasser Zamani


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 "/> 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 :)

Regards.