myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Custom Navigation Handler" by Guy Bashan
Date Thu, 09 Mar 2006 15:34:13 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The following page has been changed by Guy Bashan:
http://wiki.apache.org/myfaces/Custom_Navigation_Handler

------------------------------------------------------------------------------
  For these reasons (And also for the reason of solving complex dynamic navigation issues),
assuming redirection is the preferable way of navigating between pages, one should consider
using a custom Navigation Handler adding the following capabilities:
   1. Custom dynamic redirection to any page: This simply allows to return an action result
which will cause the Navigation Handler to directly redirect to a page. For example, in order
to redirect to a url:
  
+ {{{
- function String saveAction()
+   function String saveAction()
- {
+   {
-   ..
+     ..
-   ..
+     ..
-   return "redirect:save_ok.jsp"
+     return "redirect:save_ok.jsp"
- }
+   }
+ }}}
  
- Pay attention, that in order to directly redirect to a specific page the prefix: "redirect:"
was addedd. Also page attention to the fact that only the relative path is used.
+   Pay attention, that in order to directly redirect to a specific page the prefix: "redirect:"
was addedd. Also page attention to the fact that only the relative path is used.
  
   2. Dynamic Url parameters passing: This allows passing parameters between pages even when
using redirection method. For exmaple, in order to navigate from a pages name: view.jsp to
a page named: edit.jsp, with the parameter: objectId, the following thing can be done in navigation
rule code:
  
+ {{{
    <navigation-rule>
      <from-view-id>/view.jsp</from-view-id>
      <navigation-case>
@@ -41, +44 @@

        <redirect />
      </navigation-case>
    </navigation-rule>
+ }}}
  
- In view.jsp file the command link looks like:
+   In view.jsp file the command link looks like:
  
+ {{{
- <h:commandLink value="Edit" action="edit" />
+   <h:commandLink value="Edit" action="edit" />
+ }}}
  

Mime
View raw message