Author: jfrederic.clere(a)jboss.com
Date: 2008-01-18 02:56:24 -0500 (Fri, 18 Jan 2008)
New Revision: 401
Modified:
trunk/java/org/jboss/web/php/ScriptEnvironment.java
Log:
Improve previous patch for Portal support.
Submittted by Thomas Heute.
Modified: trunk/java/org/jboss/web/php/ScriptEnvironment.java
===================================================================
--- trunk/java/org/jboss/web/php/ScriptEnvironment.java 2008-01-17 23:57:39 UTC (rev 400)
+++ trunk/java/org/jboss/web/php/ScriptEnvironment.java 2008-01-18 07:56:24 UTC (rev 401)
@@ -565,18 +565,20 @@
this.webAppRootDir = context.getRealPath("/");
this.tempDir = (File)context.getAttribute(Globals.WORK_DIR_ATTR);
- this.contextPath = req.getParameter("context");
- if (this.contextPath == null) {
- this.contextPath = req.getContextPath();
- }
- this.servletPath = req.getParameter("servlet");
- if (this.servletPath == null) {
- this.servletPath = req.getServletPath();
+ if (req.getAttribute(Globals.INCLUDE_CONTEXT_PATH_ATTR) != null) {
+ // Include
+ this.contextPath = (String)
req.getAttribute(Globals.INCLUDE_CONTEXT_PATH_ATTR);
+ this.servletPath = (String)
req.getAttribute(Globals.INCLUDE_SERVLET_PATH_ATTR);
+ this.pathInfo = (String) req.getAttribute(Globals.INCLUDE_PATH_INFO_ATTR);
}
+ else {
+ // Direct call
+ this.contextPath = req.getContextPath();
+ this.servletPath = req.getServletPath();
+ this.pathInfo = req.getPathInfo();
+ }
- this.pathInfo = req.getPathInfo();
-
// If getPathInfo() returns null, must be using extension mapping
// In this case, pathInfo should be same as servletPath
if (this.pathInfo == null) {
Show replies by date