Here I have a bean class which updates the database. This may be seen as a DAO class. In this bean's method we are calling a COBOL program based on some criteria. This bean's method is being called though many other calls. These calls are to methods declared in other beans. These calls are originally being initiated out of a servlet (the general course in web application scenario).
Now we want a configurable option, may be a check box at the start of the application loading. This will affect which COBOL program will be called in THEBEAN method.
One way is to edit all the method call starting with the first one in the chain of method calls. But I think that will be a lazy way to do that. Also will lead to bad code. So any one has an idea how to set this up in some properties file and read it from there. In the bean class we don't have access to context or config to get at the file stored on the server. Please help me see it through. TIA.
I am using Tomcat 5.0 Sevlet 2.4 JDK1.5 on windows XP.
Thanks Bear for quick response. Here is what I am trying to do
(but am not able to get the results as desired please tell what I need to do different)
Code I am using in a servlet, where I have access to session/servletContext. The file is inside the WEB-INF directory as in the path above. Now to
access the same properties file inside a bean class where I don't have
access to session and context objects. As said in the first post- I don't
want to keep them passing through chain of method calls which are 6-8 in number.
I am trying
And this is the error that I am getting Other paths that I have tried with are -
I am using Tomcat5.0 Servlet2.4 JDK1.5 Eclipse Europa on Windows XP.