Controlling Page Navigation in JSF - Static and Dynamic Navigation
By Jagan Viewed: 31779 times Emailed: 216 times Printed: 269 times
Static and Dynamic Navigation
When you control navigation through string values of the action attribute, the path of navigation is known when the application is deployed. We call this static navigation, because the flow is statically determined and does not change. It is the same for every request. When using static navigation, you explicitly code a value into the action attribute of a JSF custom tag. You then define navigation rules in a configuration file. The rule specifies navigation flow when the <from-outcome> of a page matches the value of the action attribute. When that occurs, navigation flows to the specified <to-view-id>. These elements are part of a navigation rule element in a configuration file, such as faces-config.xml.
When you control navigation through value-binding expressions or method-binding expressions, the path of navigation is not known when the application is deployed. In fact, navigation flow can vary from request to request depending on the value of the expression. We call this dynamic navigation.
For dynamic navigation, you use a value-binding expression or method-binding expression as the value of the action attribute. With value-binding expressions, the value of the property must be of type String. With method-binding expressions, the method must take no parameters and return a value of type String:
public String search();
The String value returned by the method is compared to the value specified in the navigation rule to determine where control flow should go.
Comments(0)
Be the first one to add a comment
Latest Tutorials
| [2008-08-13] | Struts Vs JSF (A comparison of Struts against JSF) |
| [2007-10-06] | faces-config.xml to DirectTraffic in the JSF Application |
| [2007-10-06] | <convertNumber> and <convertDateTime> in JSF |
| [2007-10-06] | Action listeners in JSF |
| [2007-10-06] | Calling Multiple Listeners in JSF |
| [2007-09-19] | Using Javascript in JSF |
| [2007-09-19] | How to open a new browser window from my JSF page? |
| [2007-09-19] | Servlet error : java.lang.IndexOutOfBoundsException (JSF RI 1.1_01: IndexOutOfBoundsException) |
| [2007-09-19] | JSF - TreeNode.setID gets IllegalArgument Exception |
| [2007-09-18] | Install and Deploy JBoss Application Server |
| [2007-09-18] | What is JSF (JavaServer Faces)? |
| [2007-09-18] | Differences between JavaServer Faces technology and Struts |
| [2007-09-18] | JSF Basics |
| [2007-09-18] | The Relationship Between JSF and Other Java EE Technologies |
| [2007-09-18] | JSF Life Cycle |
Most Viewed Articles (in last 30 days)

