On Monday 06 June 2005 22:21, Craig McClanahan wrote: > On 6/6/05, Emond Papegaaij <[EMAIL PROTECTED]> wrote: > > On Monday 06 June 2005 18:06, [EMAIL PROTECTED] wrote: > > > I believe that you can use a string instead of a binding expression, > > > like you would a action forward (action='next') > > > > This is indeed possible, but EL makes no distinction between a constant > > and an expression. To get the constant, the expression needs to be > > evaluated. It is possible to evaluate this constant in a custom > > ActionListener, but that would mean the expression is evaluated twice. > > Don't use an expression: > <h:commandButton ... action="#{next}"/> > instead, use a literal String: > <h:commandButton ... action="next"/> > > The JSF runtime recognizes this scenario, and uses "next" as the > logical outcome value to be fed in to the navigation rules, without > calling an application action. That means the only thing you need to > do is define navigation rules that determine where to go next -- and > with those, you can make "next" mean something different depending on > which page you're currently on.
This means I have to create navigation rules for all actions and pages, even though they are all identical. This will result in a faces-config with lots of declarations like this (for every page): <navigation-rule> <from-view-id>/a.jsp</from-view-id> <navigation-case> <from-outcome>action1</from-outcome> <to-view-id>/a.do</to-view-id> </navigation-case> <navigation-case> <from-outcome>action2</from-outcome> <to-view-id>/a.do</to-view-id> </navigation-case> <!-- etc... --> </navigation-rule> Maybe I should explain a little more about the context of these pages. For the company I work for, I'm setting up a framework based on Struts and JSF. It uses a different configuration file containing modules (not Struts modules). These modules are translated into actions. I'm not planning to use the JSF navigation rules for navigation through the application, because all functionality for navigating through the application is provided by the framework with actions. Having to define the navigation rules in a static way severely limits the usability of the framework. I don't suppose it is possible to have a single rule like this: <navigation-rule> <from-view-id>/*.jsp</from-view-id> <navigation-case> <from-outcome>*</from-outcome> <to-view-id>/{1}.do</to-view-id> </navigation-case> </navigation-rule> Is implementing my own NavigationHandler the only way to achieve this, or am I missing something? Emond Papegaaij --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]