I have some architecture level problem in my application. I describe in detail here.
Guys with Jsp- Struts, Dao(Ibatis) experience can understand an help me.
I use SOA i.e. Service Oriented Architecture along with DAO in my current web application in Jsp-Struts. When user requests a page, in Struts action class, appropriate service is called. The serviceImpl class during its construction, loads properties file. The code for this is
public DefaultServiceImpl() {
super();
try {
Properties props = new Properties();
props.load(Resources.getResourceAsStream("properties/dailystatus.properties"));
String resource = "properties/dao.xml";
Reader reader = Resources.getResourceAsReader(resource);
DaoManager.configure(reader);
} catch(Exception e) {
throw new RuntimeException("Could not initiate service. Cause: " + e);
}
}
My Services extend this class. Since session object is not available (though application is available because of ServiceFactory class used in action) in this class, there is no way to change the properties file dynamically in action class, depending on users choice.
The root of this problem is here. The application was developed for one department using one database. Now, three different departments are proposed to use the same application without changing code but just changing database when dept is changed.
In short, I want to dynamically set properties file in the above constructer.
Reply for further explanation.
Thanks in advance for helping me.
Girish Varde
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello all.
I have some architecture level problem in my application. I describe in detail here.
Guys with Jsp- Struts, Dao(Ibatis) experience can understand an help me.
I use SOA i.e. Service Oriented Architecture along with DAO in my current web application in Jsp-Struts. When user requests a page, in Struts action class, appropriate service is called. The serviceImpl class during its construction, loads properties file. The code for this is
public DefaultServiceImpl() {
super();
try {
Properties props = new Properties();
props.load(Resources.getResourceAsStream("properties/dailystatus.properties"));
String resource = "properties/dao.xml";
Reader reader = Resources.getResourceAsReader(resource);
DaoManager.configure(reader);
} catch(Exception e) {
throw new RuntimeException("Could not initiate service. Cause: " + e);
}
}
My Services extend this class. Since session object is not available (though application is available because of ServiceFactory class used in action) in this class, there is no way to change the properties file dynamically in action class, depending on users choice.
The root of this problem is here. The application was developed for one department using one database. Now, three different departments are proposed to use the same application without changing code but just changing database when dept is changed.
In short, I want to dynamically set properties file in the above constructer.
Reply for further explanation.
Thanks in advance for helping me.
Girish Varde
PLEASE DO NOT CROSS POST QUESTIONS!
...as people tend to post cross answers.
THIS IS A USER SUPPORT QUESTION AND IS NOT RELATED TO THE DEVELOPMENT OF THE IBATIS FRAMEWORK. PLEASE POST ON THE USER SUPPORT FORUM IN THE FUTURE.