tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: OT: servlet 2.4: write a file to a war
Date Fri, 02 Jan 2004 03:37:54 GMT

The only place you can count on existing for writing is the tempdir defined 
by the servlet container.

File temp = (File)context.getAttribute("javax.servlet.context.tempdir");

Otherwise, you can set up a deployment parameter for your deployer to 
configure that specifies a directory for writing.  This can be either a 
JNDI environment variable or a context parameter.  You can set up defaults 
in the web.xml and the deployer can override these with proprietary server 
configuration.

Jake

At 06:34 PM 1/1/2004 -0500, you wrote:
>I am storing images to db as a blob. I want to cache the images to files 
>so I do not hit the db everytime.
>
>Question: How do I write to a file... when I am deploying a war file?
>Where am I allowed to write and delete w/ a Servlet 2.4 (again... a war file).
>
>tia,
>.V
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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


Mime
View raw message