Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 85113 invoked from network); 5 Feb 2003 17:09:46 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 5 Feb 2003 17:09:46 -0000 Received: (qmail 16489 invoked by uid 97); 5 Feb 2003 17:11:16 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 16482 invoked from network); 5 Feb 2003 17:11:15 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 5 Feb 2003 17:11:15 -0000 Received: (qmail 83675 invoked by uid 500); 5 Feb 2003 17:09:29 -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 83664 invoked from network); 5 Feb 2003 17:09:28 -0000 Received: from poster.ptc.com (HELO mxrelay.ptc.com) (12.11.148.30) by daedalus.apache.org with SMTP; 5 Feb 2003 17:09:28 -0000 Received: from HQ-EXFE4.ptcnet.ptc.com (localhost [127.0.0.1]) by mxrelay.ptc.com (8.9.0/8.9.0) with ESMTP id MAA21439 for ; Wed, 5 Feb 2003 12:09:30 -0500 (EST) Received: from hq-mail1.ptcnet.ptc.com ([132.253.201.71]) by HQ-EXFE4.ptcnet.ptc.com with Microsoft SMTPSVC(5.0.2195.5329); Wed, 5 Feb 2003 12:05:23 -0500 Received: from ptc.com ([132.253.96.61]) by hq-mail1.ptcnet.ptc.com with Microsoft SMTPSVC(5.0.2195.4905); Wed, 5 Feb 2003 12:05:23 -0500 Message-ID: <3E41442A.5040702@ptc.com> Date: Wed, 05 Feb 2003 12:04:42 -0500 From: Erik Price User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tomcat Users List Subject: Re: JSP's in other directories References: <000a01c2ccc4$3a258930$6401a8c0@Campbellnn1> In-Reply-To: <000a01c2ccc4$3a258930$6401a8c0@Campbellnn1> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 05 Feb 2003 17:05:23.0858 (UTC) FILETIME=[C5B43720:01C2CD38] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Nicholas J Campbell wrote: > Hi, > I have a question, I want to be able to access JSP pages that > are outside of the web-inf directory setup by tomcat�I do not know how > to do it, obviously. I have Apache 2 installed and use that at my main > server and then am running tomcat for the purposes of Servlets and JSP�s > and I want to know what I have to do to make myself be able to access a > jsp page that is in a directory like c:\site You should generally be able to refer to resources in your site by using a path relative to the context. For instance, I have the following site structure: /MyApp index.jsp main.jsp others.jsp /WEB-INF /classes /com /ptc /myapp SomeClass.class OtherClass.class /server SomeServlet.class OtherServlet.class /lib somejar.jar To access one of my JSPs from another JSP, I just use a relative path in the "HTML" part of the JSP. To forward to one of my JSPs from a servlet, I use the following line of code: String TARGET_JSP = "/main.jsp"; javax.servlet.ServletContext sc = this.getServletContext(); javax.servlet.RequestDispatcher rd = sc.getRequestDispatcher(TARGET_JSP); rd.forward(); That's one way to do it, even though the servlet is in /MyApp/WEB-INF/classes and the JSP is in /MyApp. Erik --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org