Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSF EL conditional statement returning a jsf el syntax problem  RSS feed

 
Jeff Pace
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
#{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

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!