Return-Path: Delivered-To: apmail-jakarta-jetspeed-dev-archive@www.apache.org Received: (qmail 75241 invoked from network); 4 Feb 2005 01:07:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 4 Feb 2005 01:07:23 -0000 Received: (qmail 25447 invoked by uid 500); 4 Feb 2005 01:07:21 -0000 Delivered-To: apmail-jakarta-jetspeed-dev-archive@jakarta.apache.org Received: (qmail 25429 invoked by uid 500); 4 Feb 2005 01:07:21 -0000 Mailing-List: contact jetspeed-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jetspeed Developers List" Reply-To: "Jetspeed Developers List" Delivered-To: mailing list jetspeed-dev@jakarta.apache.org Received: (qmail 25416 invoked by uid 500); 4 Feb 2005 01:07:21 -0000 Received: (qmail 25413 invoked by uid 500); 4 Feb 2005 01:07:21 -0000 Received: (qmail 25410 invoked by uid 99); 4 Feb 2005 01:07:21 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Thu, 03 Feb 2005 17:07:21 -0800 Received: (qmail 75211 invoked by uid 1813); 4 Feb 2005 01:07:20 -0000 Date: 4 Feb 2005 01:07:20 -0000 Message-ID: <20050204010720.75210.qmail@minotaur.apache.org> From: rogerrut@apache.org To: jakarta-jetspeed-2-cvs@apache.org Subject: cvs commit: jakarta-jetspeed-2/portals-bridges/php/src/java/org/apache/portals/bridges/php PHPApplicationPortlet.java X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N rogerrut 2005/02/03 17:07:20 Modified: portals-bridges/perl/src/java/org/apache/portals/bridges/perl PerlPortlet.java portals-bridges/php/src/java/org/apache/portals/bridges/php PHPApplicationPortlet.java Log: Cleanup of code to get the context/real path for PHP and PERL portlets Revision Changes Path 1.5 +7 -6 jakarta-jetspeed-2/portals-bridges/perl/src/java/org/apache/portals/bridges/perl/PerlPortlet.java Index: PerlPortlet.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/portals-bridges/perl/src/java/org/apache/portals/bridges/perl/PerlPortlet.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PerlPortlet.java 14 Jan 2005 21:07:56 -0000 1.4 +++ PerlPortlet.java 4 Feb 2005 01:07:19 -0000 1.5 @@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletResponseWrapper; import javax.portlet.PortletConfig; +import javax.portlet.PortletContext; import javax.portlet.PortletException; import javax.portlet.PortletURL; import javax.portlet.RenderRequest; @@ -268,11 +269,11 @@ // Open the perl script and extract the perl executable path. It's the same way as apache HTTP executes PERL String perlExecutable = null; - String pathTranslated = ((HttpServletRequest)((HttpServletRequestWrapper) request).getRequest()).getPathTranslated(); - String contextPath = request.getContextPath(); - - contextPath = pathTranslated.substring(0, pathTranslated.indexOf("webapps") + 7) + contextPath + "/"; - contextPath += scriptPath; + PortletContext portletApplication = getPortletContext(); + String path = portletApplication.getRealPath("/WEB-INF"); + String contextPath = path + "/"; + + contextPath += scriptPath; // Build full path to scripts if (perlScript.startsWith("/") == false ) 1.3 +5 -3 jakarta-jetspeed-2/portals-bridges/php/src/java/org/apache/portals/bridges/php/PHPApplicationPortlet.java Index: PHPApplicationPortlet.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/portals-bridges/php/src/java/org/apache/portals/bridges/php/PHPApplicationPortlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- PHPApplicationPortlet.java 14 Jan 2005 21:05:50 -0000 1.2 +++ PHPApplicationPortlet.java 4 Feb 2005 01:07:20 -0000 1.3 @@ -23,6 +23,7 @@ import javax.portlet.ActionResponse; import javax.portlet.GenericPortlet; import javax.portlet.PortletConfig; +import javax.portlet.PortletContext; import javax.portlet.PortletException; import javax.portlet.PortletSession; import javax.portlet.PortletURL; @@ -273,8 +274,9 @@ // Build the context path String contextPath = request.getContextPath(); - String pathTranslated = ((HttpServletRequest)((HttpServletRequestWrapper) request).getRequest()).getPathTranslated(); - String rootContextPath = pathTranslated.substring(0, pathTranslated.indexOf("webapps") + 7) + contextPath + "/"; + PortletContext portletApplication = getPortletContext(); + String path = portletApplication.getRealPath("/WEB-INF"); + String rootContextPath = path + "/"; /* * At this point we have all the information to run the PHP servlet: --------------------------------------------------------------------- To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org