| Author |
JSF EL conditional statement returning a jsf el syntax problem
|
Jeff Pace
Greenhorn
Joined: Sep 04, 2009
Posts: 2
|
|
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.
|
 |
Babu Subburathinam
Greenhorn
Joined: Sep 03, 2009
Posts: 7
|
|
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}?
|
 |
Jeff Pace
Greenhorn
Joined: Sep 04, 2009
Posts: 2
|
|
#{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
|
 |
 |
|
|
subject: JSF EL conditional statement returning a jsf el syntax problem
|
|
|