Page 1 of 1

Refresh browser will trigger the last event

Posted: 17 Mar 2011, 21:05
by max
Hi,

Anyone had an issue to refresh the browser? when I refresh the browser, the last event will be triggered again. For example last action I did a delete, when I refresh my browser, it will do that delete again. How can I avoid that? My managed bean is in session scope, I wish refresh will call the managed bean's constructor or maybe do nothing (disable the refresh).

Thanks
max

Re: Refresh browser will trigger the last event

Posted: 18 Mar 2011, 16:10
by bumble.bee
Sounds like you need to use the post-redirect-get pattern (http://en.wikipedia.org/wiki/Post/Redirect/Get).

With JSF 2 you can add:

Code: Select all

?faces-redirect=true
to your url/action.