• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Set managed property in faces-confg from .propoerties file

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it possible to set a managed property in a faces-config.xml from a .properties file like:

<managed-property>
<property-name>dbName</property-name>
<value>prop.getProperty("database.name")</value>
</managed-property>
 
Saloon Keeper
Posts: 28718
211
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
No, you can't put Java code in faces-config. You can, however use EL. So as long as you have the bean in question mapped under a name in a context that the EL processor can use, you can do it. However, I don't know anything that's available off the shelf.

If you are using Spring and have added the Spring EL properties resolver to the faces-config, you can let Spring construct a bean based on those properties and inject it into JSF.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic