After reading Mike Bremford's workaround and spending a little
more time troubleshooting, I've found a workaround which works
with the ApJServAction and rewrite directives. Here's a summary
note and a patch.
rob
---
Here's what I noticed while trying to convert from JServ
to Tomcat using Apache. I had many "ApJServAction" directives
which mapped some file extensions to a servlet
(ie. "ApJServAction .tsp /servlet/gnutsp").
Also, I had some rewrite directives to which stripped url embedded
information (ie. "RewriteRule ^(.*,[0123]t,.*)\.html$ $1.tsp").
I got these to work by replacing the requestURI with the
rewritten URI.
Initially, the rewritten uri is store in pathInfo.
The original uri is stored in requestURI.
The mapped servlet (from ApJServAction) is stored in "script name".
If the requestURI value is replaced, it's backed up in the
attribute "org.apache.mod_rewrite.originalURI".
As a side note, if you use ApJServAction, make sure the
Initially, the rewritten uri is store in pathInfo.
---
*** Ajp12ConnectionHandler.java.orig
--- Ajp12ConnectionHandler.java
***************
*** 296,303 ****
dummy =3D ajpin.readString(null); //script =
filename
// System.out.println("AJP: Script filen=" + dummy);
dummy = ajpin.readString(null); //script name
! // System.out.println("AJP: Script name=" + dummy);
serverName = ajpin.readString(""); //server name
if( doLog ) log("AJP: serverName=" + serverName );
--- 296,321 ----
dummy = ajpin.readString(null); //script =
filename
// System.out.println("AJP: Script filen=" + dummy);
+ // Here's what I noticed while trying to convert from JServ
+ // to Tomcat using Apache. I had many "ApJServAction" directives
+ // which mapped some file extensions to a servlet
+ // (ie. "ApJServAction .tsp /servlet/gnutsp").
+ // Also, I had some rewrite directives to which stripped url
+embedded
+ // information (ie. "RewriteRule ^(.*,[0123]t,.*)\.html$
+$1.tsp").
+ // I got these to work by replacing the requestURI with the
+ // rewritten URI.
+ // Initially, the rewritten uri is store in pathInfo.
+ // The original uri is stored in requestURI.
+ // The mapped servlet (from ApJServAction) is stored in "script
+name".
+ // If the requestURI value is replaced, it's backed up in the
+ // attribute "org.apache.mod_rewrite.originalURI".
+ // As a side note, if you use ApJServAction, make sure the
+ // Initially, the rewritten uri is store in pathInfo.
+ //
dummy = ajpin.readString(null); //script name
! if( doLog ) log("AJP: Script name=" + dummy );
! if( !"".equals(dummy) ) {
! dummy += pathInfo;
! if( !requestURI.equals(dummy) ) {
!
setAttribute("org.apache.mod_rewrite.originalURI", requestURI);
! requestURI = pathInfo;
! if( doLog ) log("AJP: URI rewritten to =
"+requestURI);
! }
! }
serverName = ajpin.readString(""); //server name
if( doLog ) log("AJP: serverName=" + serverName );