Peter Crowther wrote:

From: SOA Work [mailto:[EMAIL PROTECTED]


Check the Servlet Spec (version 2.4 is at
http://www.jcp.org/aboutJava/communityprocess/final/jsr154/
) for questions of this kind.

From memory in both cases (so treat with caution):


1.) am I allowed to call main methods or programms in my web applicatio?


If you wish to be spec-compliant, no.  However, it should work depending
on Tomcat's security settings.


Really? I thought you could do anything within a Servlet that you can do within normal Java code. Also, a restriction on calling the "main()" method within a class seems nonsensical, because one can simply rename that method.



2.) am I allowed to write files on the disk from within an web application? If I am, something went wrong while trieing ;-) Can i write anywhere or have I to write to my application dir or to temp dir or something.



If you wish to be spec-compliant, you can only write to a temporary
directory that you ask the context for.  However, this may or may not be
enforced depending on Tomcat's security settings.


This point I'm less sure on, but I would think it's the role of the *servlet container* to be spec-compliant, not the programmer of a servlet. But FWIW, the Tomcat Administration Web Application (separate download in 5.5.x[1]) does alter the XML files located in the Tomcat /conf directory. If the original questioner is having problems altering text files located on the server, perhaps the code for the Admin application would be a good reference for him.

Glen

[1] http://tomcat.apache.org/download-55.cgi


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to