tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pat <>
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" <> wrote: > From: Chris Pat []

> 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

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:
To unsubscribe, e-mail:
For additional commands, e-mail:

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