|
MyEclipse 下开发JSF教程(8) <!-- Navigation rules --> <navigation-rule> <description>List of books</description> <from-view-id>/listBooks.jsp</from-view-id> <navigation-case> <from-outcome>editBook</from-outcome> <to-view-id>/editBook.jsp</to-view-id> </navigation-case> </navigation-rule>
<navigation-rule> <description>Add or edit a book</description> <from-view-id>/editBook.jsp</from-view-id> <navigation-case> <from-outcome>listBooks</from-outcome> <to-view-id>/listBooks.jsp</to-view-id> <redirect/> </navigation-case> </navigation-rule> </faces-config>
<navigation-rule> Define a navigation rule <from-view-id>/listBooks.jsp</from-view-id> Define the jsp file for which the containing navigation rule is relevant. <navigation-case> Define a navigation case <from-outcome>editBook</from-outcome> Define a name for this navigation case <to-view-id>/listBooks.jsp</to-view-id> Refers to the setted JSP File <redirect/> All parameters saved in the request will be losed when you set this tag.
If you want to Access the bean classes in your JSP files, you have to register the bean classes in faces-config.XML Add the following source code. <!-- Managed beans --> <managed-bean> <description>
|