tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Sabroff <mike.sabr...@cygnusb2b.com>
Subject Re: Getting directory in which app is deployed
Date Fri, 10 Feb 2006 18:14:47 GMT
have your external process use a script that points to the webdirectory 
or if you use servlets, set an init param in the web.xml or in 
server.xml set an environment variable:
<!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
or set a session variable in a jsp

Wojciech Ciesielski wrote:
>
> Hi there,
>
> I have one problem... We have to execute external Java process from 
> JAR archive included in our web application directory. The problem is, 
> that all system dependant functions are relative to tomcat home 
> directory. And - when our application is deployed outside tomcat 
> directory via server.xml context definition - we cannot find a way to 
> get path to our web directory...
>
> I am not sure if I am expressing myself clear, so example...
>
> I have web app with structure:
>
> someDir/web:
>   WEB-INF
>   META-INF
>   dirWithArchive
>     externalProgram.jar
>   ...
>
> which is deployed OUTSIDE tomcat. I need to execute such code:
>
> Process = new ProcessBuilder("java -jar 
> some/path/to/someDir/web/dirWithArchive/externalProgram.jar".split("\\s+").start();
>
> from within struts action or struts plugin. HOW can I find a path 
> without specifying it manualy (it's problematic because of different 
> environments we deploy our application to).
>
> TIA
>
> Wojciech Ciesielski
> Software Mind | Where Quality Meets the Future
>
> mailto:woci@softwaremind.pl
> tel./fax: +48-12 6145170
> http://www.softwaremind.pl
>

-- 
Mike Sabroff
Web Services
Developer
mike.sabroff@cygnusb2b.com
920-568-8379


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message