Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 82070 invoked from network); 30 Sep 2005 17:57:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Sep 2005 17:57:00 -0000 Received: (qmail 83740 invoked by uid 500); 30 Sep 2005 17:56:55 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 83724 invoked by uid 500); 30 Sep 2005 17:56:55 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 83713 invoked by uid 99); 30 Sep 2005 17:56:55 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Sep 2005 10:56:55 -0700 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=INVALID_DATE X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [209.73.160.68] (HELO n1b.bulk.scd.yahoo.com) (209.73.160.68) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 30 Sep 2005 10:56:59 -0700 Received: from [66.218.69.3] by n23.bulk.scd.yahoo.com with NNFMP; 30 Sep 2005 17:56:31 -0000 Date: 30 Sep 2005 10:56:31 -0700 X-yahoo-newman-property: wss X-yahoo-newman-id: null Received: from [66.218.85.32] by mailer3.bulk.scd.yahoo.com with SMTP; 30 Sep 2005 17:56:31 -0000 Received: from milter1.wss.scd.yahoo.com (66.218.85.48) by mta1.wss.scd.yahoo.com (7.0.042) id 42FD9637016113C7 for tomcat-dev@jakarta.apache.org; Fri, 30 Sep 2005 10:56:31 -0700 Received: from [10.8.1.107] (i60-34-96-164.s04.a013.ap.plala.or.jp [60.34.96.164]) (authenticated bits=0) by milter1.wss.scd.yahoo.com (8.13.1/8.13.1) with ESMTP id j8UHsp04030158 for ; Fri, 30 Sep 2005 10:55:52 -0700 (PDT) Message-ID: <433D7C20.3090207@knowleses.org> Date: Sat, 01 Oct 2005 02:55:44 +0900 From: Rick Knowles User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Developers List Subject: Re: Embedded Tomcat References: <845a197e0509301010l77a7fbb3pdc1f268992d389e3@mail.gmail.com> In-Reply-To: <845a197e0509301010l77a7fbb3pdc1f268992d389e3@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [60.34.96.164] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Eric Holk wrote: >I'm working on a project where I would like to run a simple web front end >for it. To save the time of implementing my own HTTP server I'd like to >embed Tomcat. I've read several documents on how to do this, and I've >managed to get Tomcat running inside my program. However, all the examples >I've seen show how to load a WAR file and use that as a web application. If >it's possible, I'd rather just have a sevlet class inside my program that >Tomcat uses rather than having an external web application. > You should be able to get away with just a single external file: a web.xml file that mounts the servlet and maps it to a URI pattern. The rest of the webapp code (ie the servlet class you mentioned) would be able to be inside the main jar, because class loader inheritance would cause the servlet class to be visible even if it's not in the WEB-INF/classes folder. If one external file is too many, you might need to do something tricky to set the webapp's mounted instances from code. Maybe via JMX ? Someone else might be able to help here .... Rick -- Servlet v2.4 container in a single 155KB jar file ? Try Winstone (http://winstone.sourceforge.net/) --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org