I have 2 applications deployed in tomcat, I want to use in one project resource files located in other projects WEBINF folder. Can I have an acess to another project like this?
in my project A I want to access project B like this:
<bean id="Configuration"
class="com.ws.configuration.WebServiceConfiguration"
init-method="init">
<property name="ConfigXml" value="webserviceconfiguration.xml" />
<property name="executingPathResource" value="../../projectB/WEB-INF/" />
<property name="developmentMode" value="true" />
</bean>
note: I use spring, can I give path to another projects web inf folder?
tnx
What about one of the following:
you could place your resource file outside of Tomcat and reference it from both web applications using a JNDI context. If you know the root directory of your config files you could use some kind of logic to find out where your files are. Relative path is preferred over absolute, since your application may have different position within the file system depending on the environment: development vs test vs production. Still, knowing a root of the config files (which also might be set using environment variables) and a little bit logic you could get to the file from any web application.
the resource files get accessed using
ClassLoader.getResourceAsStreamand you put them into the classpath, for example webserviceconfiguration.xml being inside one of the source directories referenced by both applications. This way you can end up with the file inside both WEB-INFs, or wherever your classes end, but it will have always the same contents because it would result from the same source file.