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?
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.
Joined: Jul 03, 2008
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.