Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 59669 invoked from network); 24 Aug 2002 06:45:49 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 24 Aug 2002 06:45:49 -0000 Received: (qmail 25425 invoked by uid 97); 24 Aug 2002 06:46:10 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@jakarta.apache.org Received: (qmail 25381 invoked by uid 97); 24 Aug 2002 06:46:09 -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 25362 invoked by uid 98); 24 Aug 2002 06:46:08 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) To: tomcat-user@jakarta.apache.org X-Injected-Via-Gmane: http://gmane.org/ Path: not-for-mail From: "Bill Barker" Newsgroups: gmane.comp.jakarta.tomcat.user Subject: Re: Moving between JSPs and Servlets within a webapp Date: Fri, 23 Aug 2002 23:51:44 -0700 Lines: 55 Message-ID: References: NNTP-Posting-Host: lsanca2-ar30-4-46-194-091.lsanca2.dsl-verizon.net X-Trace: main.gmane.org 1030171457 28515 4.46.194.91 (24 Aug 2002 06:44:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 24 Aug 2002 06:44:17 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: news X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N In your example, request.getContextPath() will return "/myapp". So code in your JSP page that looks like: Cool Servlet should do what you want. "Anthony Nolan" wrote in message news:NOEKLBLJIEIMDICEBHNNCEKKCBAA.anolan@bigpicture.ie... > Hi, > > I have a webapp which contains servlets and jsp pages. In development I keep > all jsp pages in a subdirectory of the project called 'jsp'. When I deploy > to production I use a war file and specify that the contents of the jsp > directory is to be included in the war. This expands on the production > server with the jsp files in the root of the webapp. > i.e. in development I use the url: > http://localhost:8080/myapp/jsp/myfile.jsp > in production the url is http://prodserver:8080/myapp/myfile.jsp > > this works fine except when I must redirect to a servlet from a jsp page. I > can set up the path to redirect to so that it works in development (for > example ..\servlet\myservlet), but then when I deploy to production the > relative references no longer work. I could filter the files with ant and > remove the relative references at deployment time, but would prefer a more > robust solution. Is there some way I can get a reference to a Context object > and then find my servlets relative to this? > I am using tomcat 3.3.1 and JDK 1.3. > > Can anyone help with this? > > Thanks > > Anthony Nolan > Big Picture Software > > > This E-mail and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this E-mail in error please notify us immediately and delete this E-mail from your system. Thank you. > It is possible for data transmitted by email to be deliberately or > accidentally corrupted or intercepted. For this reason, where the > communication is by E-mail, the Big Picture Group does not accept > any responsibility for any breach of confidence which may arise through the use of this medium. > Opinions, conclusions and other information in this message that do not relate to the official business of Big Picture Group shall be understood as neither given nor endorsed by it. > This footnote also confirms that this email message has been swept for the presence of known computer viruses. -- To unsubscribe, e-mail: For additional commands, e-mail: