Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 94729 invoked from network); 23 Jan 2006 14:40:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 23 Jan 2006 14:40:54 -0000 Received: (qmail 89475 invoked by uid 500); 23 Jan 2006 14:40:39 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 89424 invoked by uid 500); 23 Jan 2006 14:40:38 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 89413 invoked by uid 99); 23 Jan 2006 14:40:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2006 06:40:38 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of grm7790@verizon.net designates 206.46.252.42 as permitted sender) Received: from [206.46.252.42] (HELO vms042pub.verizon.net) (206.46.252.42) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2006 06:40:36 -0800 Received: from [127.0.0.1] ([204.36.10.128]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPA id <0ITJ00898VEZ13S1@vms042.mailsrvcs.net> for users@tomcat.apache.org; Mon, 23 Jan 2006 08:40:16 -0600 (CST) Date: Mon, 23 Jan 2006 09:39:56 -0500 From: Glen Mazza Subject: Re: writing files with a web application In-reply-to: To: Tomcat Users List Message-id: <43D4EABC.4000804@verizon.net> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-Accept-Language: es-es, es References: User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Peter Crowther wrote: >>From: SOA Work [mailto:soawork@web.de] > > > 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: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org