Well, sure it it, but you should get the inputstream from the
ServletContext object, not a FileInputStream. When you use the ant deploy
task, your app is served directly from the .war file which is perfectly
legitimate under the servlet spec. In fact, you have absolutely no
guaranteed access to the file system other than the temp directory provided
by java and and the servlet spec. So, you should be using...
context.getResourceAsStream("/WEB-INF/myresource.xml");
or just grab it off the classloader.
Oh, and your .war file is delivered to:
CATALINA_HOME/work/Standalone/localhost/manager (or something like that)
Jake
At 04:07 PM 4/16/2003 +0200, you wrote:
>I'm using tomcat 4.1.18, and noticed that using ant for deploying
>applications, the directory tree is not found under webapps, while this
>is the case when simply copying the application war file under webapps.
>This has consequences, for example, when referencing resources/files
>using InputStreams. I know maybe this is not a correct way to access
>resources in a web app, but i'm intersted in where my application is
>under tomcat, and why not under webapps !!!??
>
>Thanks
>Renato
>
>____________________________________
>Renato Romano
>Sistemi e Telematica S.p.A.
>Calata Grazie - Vial Al Molo Giano
>16127 - GENOVA
>
>e-mail: r.romano@set-network.com
>Tel.: 010 2712603
>_____________________________________
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
|