aspose file tools*
The moose likes JSF and the fly likes JSF Browser Refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF Browser Refresh" Watch "JSF Browser Refresh" New topic
Author

JSF Browser Refresh

Andy Holm
Ranch Hand

Joined: Jul 03, 2008
Posts: 86
I am using the POST redirect to GET code here:
http://balusc.blogspot.com/2007/03/post-redirect-get-pattern.html.

I am able to redirect my POST action to a GET and have a page loaded with URL request parameters. The request parameters are correctly updated in my managed bean thanks to entries in the faces-config file. The problem comes when I reload a page (via the browser refresh button) that shows results from a database query. The query is not re-run as I would like it to be. How do I call code in my backing bean on a browser refresh?
Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
That page you mentioned is not found.

I think you might mean this page.

cheers
Darryl.
Andres Quinones
Ranch Hand

Joined: Oct 09, 2006
Posts: 57
Andy your Backing Bean in which scope is defined?? As I understan probably is in session scope, so when you refresh your page the data is loaded as it is in the Bean. One solution could be to change it to Request and reload the data from the DB on each submit.

Hope this helps.
Andy Holm
Ranch Hand

Joined: Jul 03, 2008
Posts: 86
My beans are in request scope. The problem is that on a browser refresh the page does not automatically call my business logic. One way around this I have found is to call my business logic directly in my JSP. However, I don't like this solution because it breaks the model-view-controller pattern.

Are there other options?
Andy Holm
Ranch Hand

Joined: Jul 03, 2008
Posts: 86
In case anyone was mislead by Darryl, the URL in my original post was correct. The period at the end of the sentence mistakenly got attached to the URL. Again, the URL is http://balusc.blogspot.com/2007/03/post-redirect-get-pattern.html
Andy Holm
Ranch Hand

Joined: Jul 03, 2008
Posts: 86
Does anyone have any suggestions?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF Browser Refresh