• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Set managed property in faces-confg from .propoerties file

 
Richard Gray
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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>
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic