Hi Dan,

OK, two problems here:

1) URL encoded session ids and forwarding. I assume you are using mod_jk 1.2.23. For this problem you already found a workaround, although the JkOption is not really safe. This topi will be fixed in a nicer way in the forthcoming version 1.2.24. The reason you can not see the difference in the access logs is, that the access logs show the incoming URL, but not the forwarded URL. Apache httpd will decode %3b into ";" and mod_jk will reencode before forwarding, but unfortunately the tomcat connector doesn't understand %3b in front of jsessionid. The JkOption you have chosen will forward the decoded URL.

2) Redirects for POST requests result in GET requests

I remember, that this is a well known browser problem. Maybe other users can help on that topic. Easiest solution would be to redirect earlier, i.e. before the form comes into the game. Another option would be to use mod_rewrite to rewrite the URL only locally, but then the browsers would not "learn", that they are using a wrong URL.

Regards,

Rainer


Dan Beaulieu wrote:

I am trying to migrate our current system of apache/jserv to apache tomcat
using modjk. I am trying to shoe horn our current configuration.

I have a webapp lets call it myApp. Now some of our static content, beyond
my control, requests urls like
https://localhost/demo/myApp/servlets/aServlet;jsessionid=XXX.
I've added an entry in my httpd.conf:

Redirect /demo https://localhost

When I do this, I will get a 404 with the access_log saying:

"POST
/demo/myApp/servlets/aServlet;jsessionid=24C7A06037BBA7AF7BB44DE5C0206F8C&Re
questType=SomeRequest HTTP/1.1" 301 332
"GET
/myApp/servlets/aServlet%3bjsessionid=24C7A06037BBA7AF7BB44DE5C0206F8C&Reque
stType=SomeRequest HTTP/1.1" 404 1273

So, it looks like partly a url encoding problem. I searched around to find
out whats up, and tried this directive for mod_jk:

JkOptions     +ForwardURICompat

And now in the access_log I see this

"POST
/demo/myApp/servlets/aServlet;jsessionid=7B08C6CF734771A220CC98D82DE33466&Re
questType=SomeRequest HTTP/1.1" 301 332
"GET myApp/servlets/aServlet
%3bjsessionid=7B08C6CF734771A220CC98D82DE33466&RequestType=SomeRequest
HTTP/1.1" 200 29

So we see that the request worked(even though the url is still encoded??),
but its not actually redirecting the request. The POST is getting turned
into a GET. Tomcat is responding with the proper response for a GET request
to "/myApp/servlets/aServlet".

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to