tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pat <cpa...@yahoo.com>
Subject RE: tomcat temp directory
Date Mon, 04 Jun 2007 16:56:42 GMT
Hi Chuck
Great.  However may I ask the naive question?  
How do I get the servletContext within a method, within an Action.  Do I have to pass in the
request, and dig it out from there?  tia.

"Caldarale, Charles R" <Chuck.Caldarale@unisys.com> wrote: > From: Chris Pat [mailto:cpanon@yahoo.com]

> Subject: RE: tomcat temp directory
> 
> But how to I get at it programatically?  Is workDir an actual 
> context param that I can access and build a File from?

It's not a param, it's an attribute - read the servlet spec and the
servlet API doc.  Use the ServletContext.getAttribute() API to retrieve
the value of javax.servlet.context.tempdir, and then create files within
that directory as needed.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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



Mime
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message