voyent
How to load myapp.properties file  XML
Forum Index -> General Help
Author Message
avinniva

Joined: 27/Feb/2013 19:56:41
Messages: 14
Offline


I want to add myapp.properties file containing database connection and other setting information.

How can I add loading myapp.properties, so other beans can access required information.

I think I can add separate servlet class to load myapp.properties file and maintain config information. I am looking for ICE faces containing any listener I can extend or adapter class , so I don't have to change web.xml
avinniva

Joined: 27/Feb/2013 19:56:41
Messages: 14
Offline


Any help? Does icefaces provides application context functionality, where I can load property file and maintain connection pool and shared resources?
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


ICEfaces is a JSF web framework that does not provide any direct integration to database technologies.

.
avinniva

Joined: 27/Feb/2013 19:56:41
Messages: 14
Offline


context management to share resource across managed bean?

It doesn't have to be database connection.
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


You'll have to elaborate on exactly what you're looking for. ICEfaces is a JSF framework. JSF frameworks are servlet frameworks. JSF frameworks can also integrate with Spring.

.
avinniva

Joined: 27/Feb/2013 19:56:41
Messages: 14
Offline


I have standalone web application using icefaces and tomcat, without using spring framework. I want to load property file and maintain application context.

Does icefaces have application context?
Does icefaces provide init callback on application first load?
philip.breau


Joined: 08/May/2006 00:00:00
Messages: 2989
Offline


ICEfaces uses the JSF application context. A simple way to run something on application startup is to use an eager application scope bean with a PostConstruct method:

Code:
 @ManagedBean(eager=true)
 @ApplicationScoped
 public class Bean {
 
     @PostConstruct
     public void init(){...}
 
 }
 


You might also want to look into the the Spring PropertyPlaceHolderConfigurer for more general configuration support.

http://springtips.blogspot.ca/2008/09/configuring-applications-with-spring.html

Philip

.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team