Howdy,

>Perhaps another / better question I should ask is, if there are files
in
>your WAR that you need to open during the lifetime of your servlet, and
>assuming that your WAR does not get unpacked due to the presence of an
><app>.xml context definition, how do you open those files? Obviously
the
>java.io.* packages don't work, but are there other mechanisms specific
to
>servlets that would work?

When using servlets, you should avoid the java.io APIs to access
resources if possible.  Instead, use ServletContext#getResource or
ServletContext#getResourceAsStream.

The parameter in tomcat 4.x that controls whether a war file is packed
or not is the unpackWARs attribute of the <Host> element.  See here for
more details, especially the Automatic Application Deployment section:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#Automat
ic%20Application%20Deployment

This is why the Catalina ant tasks remove the directory corresponding to
the unpacked war before deploying a new one.

Yoav Shapira



This e-mail, including any attachments, is a confidential business communication, and 
may contain information that is confidential, proprietary and/or privileged.  This 
e-mail is intended only for the individual(s) to whom it is addressed, and may not be 
saved, copied, printed, disclosed or used by anyone else.  If you are not the(an) 
intended recipient, please immediately delete this e-mail from your computer system 
and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to