This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Modern JavaScript for the Impatient and have Cay Horstmann on-line!
See this thread for details.
Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JSF Browser Refresh

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That page you mentioned is not found.

I think you might mean this page.

cheers
Darryl.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone have any suggestions?
 
I am displeased. You are no longer allowed to read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic