Page refresh on second page

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Page refresh on second page

Venkat Ravuri
I have a question regarding page refresh. I have a jsp page ( some registration page) which goes to  myactionbean.view(), when user submits it goes to myactionbean.register() and then finally on to results jsp page( done).

When I hit browser refresh on results jsp page, my action bean is getting invoked again myactionbean.register() even though I have DefaultHandler annotation. I want the browser refresh to go back to myactionbean.view(). How do I do that?. 

Only thing that shows up on my browser windows is /register always ( for all the methods).

Also is there any way to avoid form re-submit when users clicks submit button twice?.

Thanks,
Venkat

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users
Reply | Threaded
Open this post in threaded view
|

Re: Page refresh on second page

samaxes
Hi Venkat,

You should use the Redirect-After-Post pattern, basically in your myactionbean.register() to a redirect to myactionbean.done() (or myactionbean.view()) which forwards to your JSP page.

To prevent double-click use JavaScript:
document.getElementById('buttonId').onclick = function(event) {
    event.preventDefault();
    this.disabled = true;
    this.form.submit();
};

Best,



On Mon, Feb 25, 2013 at 11:42 PM, Venkat Ravuri <[hidden email]> wrote:
I have a question regarding page refresh. I have a jsp page ( some registration page) which goes to  myactionbean.view(), when user submits it goes to myactionbean.register() and then finally on to results jsp page( done).

When I hit browser refresh on results jsp page, my action bean is getting invoked again myactionbean.register() even though I have DefaultHandler annotation. I want the browser refresh to go back to myactionbean.view(). How do I do that?. 

Only thing that shows up on my browser windows is /register always ( for all the methods).

Also is there any way to avoid form re-submit when users clicks submit button twice?.

Thanks,
Venkat

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users



------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Stripes-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-users