[Logo]
Forums Register Login
JSF EL conditional statement returning a jsf el syntax problem
I am trying to use jsf el to to a conditional statement in my faces-config.xml file.

<key>#{ (currentUserRole.userInSecureRole==true) ? agsws3 : agsws0}</key>

works perfectly

the problem is the next line needs to be

<value>#{ (currentUserRole.userInSecureRole==true) ? #{agsws3} : #{agsws0}}</value>

which of course doesnt parse

basically if it fails check it needs to be

<key>agsws0</key>
<value>#{agsws0}</value>

and if it passes

<key>agsws3</key>
<value>#{agsws3}</value>

please help! thank you.
When you use #{agsws0} it is going to start looking for a <key>agsws0</key>. Which is in the process of getting defined. So there is a cyclical dependency.

So what is the value of #{agsws0}?
#{agsws0} is another managed bean

basically i have a resource bean

that bean has properties that are a list of other beans

so

<value>#{agsws0}</value>
<value>#{agsws1}</value>
<value>#{agsws2}</value>

etc.

the <key>agsws0</key> is just the name of the value, so no cyclical dependency.

My problem is i need the jsf el conditional statement to return a reference to a bean #{agsws0} and not a string

Wink, wink, nudge, nudge, say no more ... https://richsoil.com/cards



All times above are in ranch (not your local) time.
The current ranch time is
Dec 12, 2017 05:22:28.