Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 6101 invoked from network); 15 Jan 2003 09:46:24 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 15 Jan 2003 09:46:24 -0000 Received: (qmail 2263 invoked by uid 97); 15 Jan 2003 09:47:25 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 2244 invoked by uid 97); 15 Jan 2003 09:47:25 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 2212 invoked by uid 98); 15 Jan 2003 09:47:23 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <012172501CC5D411A9D100D0B72073AA021060C8@kcobe4.nt.kone.com> From: Peng Annie To: "'tomcat-user@jakarta.apache.org'" Subject: servlet context, urgent !!! Date: Wed, 15 Jan 2003 10:44:37 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2BC7A.B7BCF040" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C2BC7A.B7BCF040 Content-Type: text/plain; charset="iso-8859-1" Hi, I am useing Apache2, Tomcat4. Now I got a problem about the servlet context. I have an main application which was configured to the DocumentRoot in httpd.conf, and the alias of this main application is just under the url root (http://servername/index.jsp will direct user to webapps/MainApplication/index.jsp). The programe need to redirect user to another application webapps/SecondApplication/, so in a servlet of the MainApplication, I use the following statements: ServletContext sc = this.getServletConfig().getServletContext().getContext("/SecondApplication") ; sc.getRequestDispatcher("/servlet/ControllerServlet").forward(request, response); But it doesn't work, I always get error The requested resource (/servlet/ControllerServlet) is not available. It seems Tomcat4 tried to find this ControllerServlet in the MainApplication. How can I get the context of SecondApplication? Should I do sth with the web.xml? By the way, the above way works fine on Tomcat3.2. Please help, many thanks! Annie ------_=_NextPart_001_01C2BC7A.B7BCF040--