You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Parvat Singh Ranawat <ma...@gmail.com> on 2009/01/30 11:33:03 UTC

How to stop action getting called on click of refresh button

Hi,
Can I stop the calling of action on click of refresh button as on this
action it will generate a report at some specified location.
So on every refresh click will generate a new report at that location which
is unacceptable.

So is there any way to stop calling the action/ have one flag on action
which determines this part of code in action need not be executed on click
on refresh button.

Regards,
Shakti

RE: How to stop action getting called on click of refresh button

Posted by Andy <an...@hotmail.com>.
I would recommend redirecting to another action/jsp after the form post (PRG pattern).


> Date: Sun, 1 Feb 2009 12:55:23 +0530
> Subject: Re: How to stop action getting called on click of refresh button
> From: go4mani@gmail.com
> To: user@struts.apache.org
> 
> >
> > So is there any way to stop calling the action/ have one flag on action
> > Which determines this part of code in action need not be executed on click
> > on refresh button.
> >
> >
> For this I think Token and/or Token Session interceptors will do the magic.
> 
> http://struts.apache.org/2.1.6/docs/token-interceptor.html
> http://struts.apache.org/2.1.6/docs/token-session-interceptor.html
> 
> 
> And I think Execute & wait interceptor will be useful to perform some
> lengthy & time taking logic to be executed in the background while the user
> is being displayed some progress bar or a simple wait page.
> And Redirect action for sharing or dividing the action logic.
> 
> Hope this helps.
> 
> 
> ManiKanta

> > Hi,

> > Can I stop the calling of action on click of refresh button as on this

> > action it will generate a report at some specified location.

> > So on every refresh click will generate a new report at that location which

> > is unacceptable.


> > So is there any way to stop calling the action/ have one flag on action

> > which determines this part of code in action need not be executed on click

> > on refresh button.


> > Regards,

> > Shakti


_________________________________________________________________
Windows Liveā„¢: E-mail. Chat. Share. Get more ways to connect. 
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t2_allup_explore_012009

Re: How to stop action getting called on click of refresh button

Posted by ManiKanta G <go...@gmail.com>.
>
> So is there any way to stop calling the action/ have one flag on action
> Which determines this part of code in action need not be executed on click
> on refresh button.
>
>
For this I think Token and/or Token Session interceptors will do the magic.

http://struts.apache.org/2.1.6/docs/token-interceptor.html
http://struts.apache.org/2.1.6/docs/token-session-interceptor.html


And I think Execute & wait interceptor will be useful to perform some
lengthy & time taking logic to be executed in the background while the user
is being displayed some progress bar or a simple wait page.
And Redirect action for sharing or dividing the action logic.

Hope this helps.


ManiKanta

Re: How to stop action getting called on click of refresh button

Posted by Ralf Fischer <th...@googlemail.com>.
On Fri, Jan 30, 2009 at 11:33 AM, Parvat Singh Ranawat
<ma...@gmail.com> wrote:
> Hi,
> Can I stop the calling of action on click of refresh button as on this
> action it will generate a report at some specified location.
> So on every refresh click will generate a new report at that location which
> is unacceptable.
>
> So is there any way to stop calling the action/ have one flag on action
> which determines this part of code in action need not be executed on click
> on refresh button.

For this action you might want to use the Execute and Wait
interceptor[1] and/or the Redirect Action Result [2].

Cheers,
-Ralf

[1] http://struts.apache.org/2.1.6/docs/execute-and-wait-interceptor.html
[2] http://struts.apache.org/2.1.6/docs/redirect-action-result.html

>
> Regards,
> Shakti
>

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