You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by gv...@C3tools.com on 2005/12/06 17:02:35 UTC

Question about strings in faces-config

Hi,

I got a simple question regarding the faces-config navigation rules. 

Right now, my rules are defined as follows:

    <navigation-case>
      <from-action>#{myBean.action}</from-action>
      <from-outcome>success</from-outcome>
      <to-view-id>/test.jsp</to-view-id>
    </navigation-case>

In the action() method I would return a constant defined in an
application scope bean that translates to "success".

My question is the following: is there a way to put EL in the
faces-config file so that I can write something like that:


    <navigation-case>
      <from-action>#{myBean.action}</from-action>
      <from-outcome>#{myConstantsBean.SUCCESS}</from-outcome>
      <to-view-id>/test.jsp</to-view-id>
    </navigation-case>

It's just because it bugs me to know that even if I use variables in my
files, a mistake can be made in faces-config and it could be an issue
for code maintenance as well.

Thanks,

greg


Re: Question about strings in faces-config

Posted by Mike Kienenberger <mk...@gmail.com>.
No, I don't think you can do this under standard JSF.   You're not
allowed to use EL expressions in your navigation rules.    However,
you should be able to subclass the standard navigation handler and
change it to evaluate the EL expresssions....

On 12/6/05, gvial@c3tools.com <gv...@c3tools.com> wrote:
> Hi,
>
> I got a simple question regarding the faces-config navigation rules.
>
> Right now, my rules are defined as follows:
>
>     <navigation-case>
>       <from-action>#{myBean.action}</from-action>
>       <from-outcome>success</from-outcome>
>       <to-view-id>/test.jsp</to-view-id>
>     </navigation-case>
>
> In the action() method I would return a constant defined in an
> application scope bean that translates to "success".
>
> My question is the following: is there a way to put EL in the
> faces-config file so that I can write something like that:
>
>
>     <navigation-case>
>       <from-action>#{myBean.action}</from-action>
>       <from-outcome>#{myConstantsBean.SUCCESS}</from-outcome>
>       <to-view-id>/test.jsp</to-view-id>
>     </navigation-case>
>
> It's just because it bugs me to know that even if I use variables in my
> files, a mistake can be made in faces-config and it could be an issue
> for code maintenance as well.
>
> Thanks,
>
> greg
>
>