tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel <dant...@yorku.ca>
Subject Re: proper way to access local dir?
Date Fri, 16 Jan 2004 19:21:00 GMT

Thanks Jim.  I like your JNDI method - hate having to muck with settings
each time I deploy on different boxes. :)

Regards,
Daniel

On Fri, 16 Jan 2004, Tim Funk wrote:

> If you don't care about where the files are written to, you can use
> "javax.servlet.context.tempdir". See the spec "SRV.3.7.1 Temporary Working
> Directories" for details.
>
> If you need a permanent local directory, I prefer to use a JNDI string lookup
> (http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html)
> to the name of the directory. This way I don't need to change my web.xml on
> my development box vs qna vs production.
>
>
>
> -Tim
>
> Daniel wrote:
>
> > Hi,
> >
> > I'm trying to access a "file respository" (for read and write of files)
> > from my servlet.  I was wondering what's the best way to do this in a
> > container/platform-independent manner?
> >
> > Is it possible without putting an "init" param in the web.xml that
> > specifies my repository's directory or hard coding it into my servlet?
> >
> > I noticed the servlet 2.3 api has ServletContext.getResource(path) but
> > it doesn't return a path to a local file directory that I'm interested
> > in. :(
> >
>
>
> ---------------------------------------------------------------------
> 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