This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes Backing bean to point to bean method and redirect page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Backing bean to point to bean method and redirect page" Watch "Backing bean to point to bean method and redirect page" New topic
Author

Backing bean to point to bean method and redirect page

tom davies
Ranch Hand

Joined: Apr 27, 2012
Posts: 168
I have a form that writes form data to a file.
It uses a method in my managed bean to do this, and is invoked my clicking the submit button.

I now want to be able to redirect the page after the button has been clicked as well as call the method.
Would i do this within my managed bean or on the form page?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15964
    
  19

You would do this in the backing bean's action method. In the normal JSF scenario, the action method would return the name of a JSF navigation rule indicating the next page to be displayed (or null, to redisplay the current page). Starting with JSF2, implicit rules are also made for JSF view resource names so you can name the target view directly if your prefer.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
Consider Paul's rocket mass heater.
 
subject: Backing bean to point to bean method and redirect page
 
Similar Threads
call a action method with h:commandButton
Trying to post to an external jsp (jsf) service...
Populate Backing Bean Exception Handling
How can I close a JSF page from the Java Bean
Calling Bean Code From JSP