bloritsch 00/07/13 05:17:21
Modified: src/org/apache/cocoon/servlet Tag: xml-cocoon2
CocoonServlet.java
Log:
Removed usage of getPathInfo() because we are mapping C2 to opperate on the
root path of the context (/). The used method was derived from conversations I had
with Servlet 2.2 vendors other than Tomcat (because it wasn't working with them).
From Gefion Software (www.gefionsoftware.com):
This is an area of the spec that has always been interpreted in
different ways by different vendors. We have recently discussed this
in the servlet specification group, and for a servlet mapped to the /
pattern, the context relative path shall be returned by the getServletPath()
method and getPathInfo() returns null. If this is not what Tomcat
returns, it's a bug in Tomcat.
This fix also makes it work with Orion's system as well.
Revision Changes Path
No revision
No revision
1.1.4.11 +6 -4 xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java
Index: CocoonServlet.java
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/servlet/Attic/CocoonServlet.java,v
retrieving revision 1.1.4.10
retrieving revision 1.1.4.11
diff -u -r1.1.4.10 -r1.1.4.11
--- CocoonServlet.java 2000/07/11 03:10:02 1.1.4.10
+++ CocoonServlet.java 2000/07/13 12:17:20 1.1.4.11
@@ -28,7 +28,7 @@
*
* @author <a href="mailto:fumagalli@exoffice.com">Pierpaolo Fumagalli</a>
* (Apache Software Foundation, Exoffice Technologies)
- * @version CVS $Revision: 1.1.4.10 $ $Date: 2000/07/11 03:10:02 $
+ * @version CVS $Revision: 1.1.4.11 $ $Date: 2000/07/13 12:17:20 $
*/
public class CocoonServlet extends HttpServlet {
private Cocoon cocoon=null;
@@ -122,7 +122,9 @@
return;
}
// We got it... Process the request
- String uri=req.getPathInfo();
+ // We should use getServletPath(), otherwise we break compatability with
+ // other Servlet 2.2 engines (like Gefion LWS and Orion)
+ String uri=req.getServletPath();
if (uri!=null) try {
if (uri.charAt(0)=='/') uri=uri.substring(1);
CocoonServletRequest request=new CocoonServletRequest(req,uri);
@@ -137,7 +139,7 @@
out.println("<hr>");
out.print("The requested URI \""+req.getRequestURI());
out.print("\" was not found.");
- out.println("<!-- PATH_INFO=\""+req.getPathInfo()+"\" -->");
+ out.println("<!-- PATH_INFO=\""+req.getServletPath()+"\" -->");
out.println("<hr></body></html>");
}
} catch (Exception e) {
@@ -171,7 +173,7 @@
out.println("<hr>");
if (reloaded) out.println("Configurations reloaded.<br>");
out.println("Ready to process requests...");
- out.println("<!-- PATH_INFO=\""+req.getPathInfo()+"\" -->");
+ out.println("<!-- PATH_INFO=\""+req.getServletPath()+"\" -->");
out.println("<hr></body></html>");
}
out.flush();
|