You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Adam Lipscombe <ad...@cobar.fsbusiness.co.uk> on 2002/07/19 11:29:00 UTC
How to deploy writeable files?
Folks,
We need to deploy some writeable text files in our J2EE app. The normal
deployment procedure is via a WAR file.
My understanding is that the container (currently Tomcat 4.0.4, but may
change) does not guarantee the place where it unpacks the WAR, hence one
cannot assume the final location of the files.
Is this the case? What is the normal approach to deploying writeable files
in a WAR?
Thanks in advance
Adam Lipscombe
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: How to deploy writeable files?
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Fri, 19 Jul 2002, Adam Lipscombe wrote:
> Date: Fri, 19 Jul 2002 10:29:00 +0100
> From: Adam Lipscombe <ad...@cobar.fsbusiness.co.uk>
> Reply-To: Tomcat Users List <to...@jakarta.apache.org>,
> adam@cobar.fsbusiness.co.uk
> To: Tomcat Users Mailing List <to...@jakarta.apache.org>
> Subject: How to deploy writeable files?
>
> Folks,
>
>
> We need to deploy some writeable text files in our J2EE app. The normal
> deployment procedure is via a WAR file.
>
> My understanding is that the container (currently Tomcat 4.0.4, but may
> change) does not guarantee the place where it unpacks the WAR, hence one
> cannot assume the final location of the files.
>
> Is this the case? What is the normal approach to deploying writeable files
> in a WAR?
>
You are not even guaranteed that a WAR *will* be unpacked -- let alone
where. Containers are perfectly free to run from a WAR file directly, in
which case ServletContext.getRealPath(), the normal way to ask for a real
pathname corresponding to a webapp resource, will return null.
To deal with writeable data, you should pass an initialization parameter
somehow that sets the pathname of the directory or file to write to.
There was a discussion in the last couple of days about using <env-entry>
to pass this value, so that you can customize it at deployment time (via
your app server's tools) without having to modify the webapp.
>
> Thanks in advance
>
>
> Adam Lipscombe
>
Craig
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>