Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 53852 invoked from network); 9 May 2006 10:36:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 May 2006 10:36:54 -0000 Received: (qmail 25569 invoked by uid 500); 9 May 2006 10:36:39 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 25553 invoked by uid 500); 9 May 2006 10:36: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 25542 invoked by uid 99); 9 May 2006 10:36:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2006 03:36:38 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [80.126.90.229] (HELO martynhiemstra.com) (80.126.90.229) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 May 2006 03:36:38 -0700 Received: from martynhiemstra.com (localhost.localdomain [127.0.0.1]) by martynhiemstra.com (Postfix) with ESMTP id 0BCE285B for ; Tue, 9 May 2006 13:05:05 +0200 (CEST) Received: from [192.168.1.151] (unknown [192.168.1.151]) by martynhiemstra.com (Postfix) with ESMTP id F026D702 for ; Tue, 9 May 2006 13:05:04 +0200 (CEST) Message-ID: <446070A1.4080209@hi-ss.nl> Date: Tue, 09 May 2006 12:36:17 +0200 From: Martyn Hiemstra Organization: Hiemstra Internet & Software Solutions User-Agent: Thunderbird 1.5.0.2 (Windows/20060308) MIME-Version: 1.0 To: users@tomcat.apache.org Subject: Adding servlets during startup Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi All I am currently using Struts 1.2.9 in combination with tomcat 5.0.28. I want to constructed my website so that its possible to import modules. Each module is a seperate package, meaning servlets are placed over multiple packages. The problem with this is that the web.xml cant contain servlet mappings because it doesnt know which modules are installed. To solve this I want to create one servlet that dynamically adds the servlets and their mappings during the startup of Tomcat. I found a function addServletMapping in The servletContext class but the problem is there is no function to add a servlet. If I understand correctly you first need to install a servlet and then its mapping. In short I need to move the servlet + servlet-mapping section from the web.xml into a single servlet that at startup adds the servlets to the list of known servlets. Thanks in advance, Martyn Hiemstra --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org