Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 81450 invoked from network); 20 Oct 2005 16:04:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 20 Oct 2005 16:04:11 -0000 Received: (qmail 26193 invoked by uid 500); 20 Oct 2005 16:03:54 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 26173 invoked by uid 500); 20 Oct 2005 16:03:54 -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 26162 invoked by uid 99); 20 Oct 2005 16:03:54 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Oct 2005 09:03:54 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of A.Mathur.1@warwick.ac.uk designates 137.205.128.7 as permitted sender) Received: from [137.205.128.7] (HELO mail-relay-1.warwick.ac.uk) (137.205.128.7) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 20 Oct 2005 09:03:53 -0700 Received: from localhost (localhost [127.0.0.1]) by mail-relay-1.csv.warwick.ac.uk (8.13.4/8.13.4) with ESMTP id j9KG3V19028030 for ; Thu, 20 Oct 2005 17:03:31 +0100 (BST) Received: from mail-relay-1.csv.warwick.ac.uk ([127.0.0.1]) by localhost (gentian [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 20501-07 for ; Thu, 20 Oct 2005 17:03:30 +0100 (BST) Received: from liberator.csv.warwick.ac.uk (host-97-8-205-137 [137.205.8.97]) by mail-relay-1.csv.warwick.ac.uk (8.13.4/8.13.4) with ESMTP id j9KFcP22011499 for ; Thu, 20 Oct 2005 16:38:25 +0100 (BST) X-Envelope-From: cusdag@gwmail.warwick.ac.uk Received: from gwia1-MTA by liberator.csv.warwick.ac.uk with Novell_GroupWise; Thu, 20 Oct 2005 16:38:24 +0100 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.0.4 Beta Date: Thu, 20 Oct 2005 16:38:14 +0100 From: "Archana Mathur" To: Subject: RE: Accessing resource from another context.. .. Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=_25073CE0.3756E73F" X-Virus-Scanned: amavisd-new at warwick.ac.uk X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --=_25073CE0.3756E73F Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable thanks Robert it works with this crossContext =3D "true" attribute.=20 >>> rgw@lsoft.com 10/20/05 04:21pm >>> Remember that you have to configure your web context "app1" to allow cross-context access. If you have not done so, the method you call below will always return null. So your context xml file should look similar to this here: I.e. the parameter crossContext=3D"true" must be there, otherwise all calls to getContext() with whatever cross-context path will return null. Robert > -----Original Message----- > From: Archana Mathur [mailto:A.Mathur.1@warwick.ac.uk]=20 > Sent: Thursday, October 20, 2005 5:03 PM > To: Subject: Accessing resource from another context.. .. >=20 >=20 > Hi, > I have got a jsp page a.jsp within tomcat 5.5.9 application=20 > (say app1). I need to access some other page a2 which is at=20 > different location ( at root context) within a.jsp. > Example - http://localhost/app1/a.jsp - (a.jsp wants access=20 > to other jsp which is at location (http://localhost/a2.jsp) -=20 > root context > =20 > tag jsp:include will only pick up pages from current context (app1) > =20 > I added had some code in my jsp page to make it working - > ServletContext ctx =3D pageContext.getServletContext().getContext("/"); > String myUrl =3D "/a2.jsp";=20 > RequestDispatcher dispatcher =3D ctx.getRequestDispatcher(myUrl);=20 > dispatcher.include(request, response); > Somehow getContext("/") returns me null. After reading=20 > getContext method ,it mentions - " In security conscious=20 > environments, the servlet engine can return null for a given=20 > URL." What do I need to do so that this getContext("/")=20 > doen't return null value.=20 > =20 > Please help.. > =20 > Archana > =20 >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org=20 For additional commands, e-mail: users-help@tomcat.apache.org=20 --=_25073CE0.3756E73F--