• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to set this managed bean's property?  RSS feed

 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm trying to create a JSF 1.1 app on WebLogic 9.2.2. I'm want to set the initial value for a managed bean's property ...

<managed-property>
<property-name>spID</property-name>
<value>#{NPSAppConfig.selectedBillSet != null && NPSAppConfig.selectedBillSet.featServiceProfiles != null ? NPSAppConfig.selectedBillSet.featServiceProfiles[0].spID : ''}</value>
</managed-property>


but this doesn't seem to be working (I get errors upon deploying). What is the proper way in EL to say "if conditions A and B are met, use this value, otherwise use this one"?

Thanks, - Dave
 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dave Alvarado:
What is the proper way in EL to say "if conditions A and B are met, use this value, otherwise use this one"?


Don't do it.

It's bad practice to embed logic in a JSF page - it breaks the MVC paradigm and it's usually more trouble than it's worth. You're better off creating a backing bean property and making that property's setter figure out where to send the data.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!