Rafal Krzewski wrote:
> Jason van Zyl wrote:
>
>
>> I've made a couple of changes now that work like
>> the following:
>>
>> TurbineResources.getServletConfig();
>> TurbineResources.getRealPath();
>
>
> These are OK with me. Just put a note in the javadoc
> for getRealPath that it is container dependent.
>
>
>> My particular requirement is the uploading of files
>> into a location in the webapp. So I need to create
>> files within the webapp. Rafal, if I can do that
>> with the method you outline then I am cool with that,
>> but I think providing easy access to the webapp.
>
>
> As per servlet spec, container will place a java.io.File
> object int the context attributes that denotes a directory
> that is guaranteed to be writable to the application.
> I think that you should use that. Can't give you the detailed
> name of the attribute right now. I checked that sometime ago
> and Tomcat seems to support that.
>
>
Sorry for jumping late here :)
This is the "work" directory. (with tomcat
http://localhost:8080/examples/jsp/test.snp, I get this:
Context attributes:
javax.servlet.context.tempdir =
/usr/share/jakarta/dist/tomcat/work/localhost_8080%2Fexamples
sun.servlet.workdir = /usr/share/jakarta/dist/tomcat/work/localhost_8080%2Fexamples
(Imagine the first one is the standard one. The latter is possibly backwards
compatibility related)
I share your concerns for jetspeed. Currently we are writing inside the webapp:
- the whole cache directory
- a persistent list of URLs with problems
- the default (tiny) databese
This will stop working if/when containers come that do not unpack the webapp, or
if/when
tight container security policies are enforced. This is likely to happen in the near
future in
some corporate environments, and in ISPs that offer webapp hosting.
In other words: we should move writable things to the "work" directory,
initializing them if they are not there on startup.
For the database, this is not a major problem, as every serious deployer
will change our "toy" sample with something better managed. I swear
thinking about a user database in a temp directory :). But the same
happens now: every time you remove the webapp expanded to get it
updated, the user database dissapears and gets replaced by the default...
For the cache/datasources.properties, I think the new implementation
will move them out of the webapp, and into the "tempdir" directory.
I copy this message to the Jetspeed list, to make people aware of these
issues.
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/[email protected]/>
List Help?: [EMAIL PROTECTED]