• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to set this managed bean's property?

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Let's get him boys! We'll make him read this tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic