Forum Moderators: phranque
Redirect /PutMsg [myserver.mycompany.local:18080...]
(I expect that there's a better way of doing this, and perhaps this is the cause of my trouble.)
The web client that I have to support is written with a combination of HTML and JavaScript. The servlet can be called either as a form action from the HTML (<form action="/PutMsg">) or as a location of a JavaScript control (I think that's right -- I don't know JavaScript).
When the call comes from the JavaScript control the URL is redirected with the query string intact, and my servlet is happy. But when it is called as the action of the HTML form submission then the URL is redirected OK but the query string is lost, and hence my servlet has no parameters to work with.
Can anyone suggest why this is happening? Bear in mind that I'm a Java/J2EE develoer with only a limited knowledge of how Apache works, so I may be missing something which would be very obvious to someone with more Apache experience.
Thanks in advance for any feedback.
--James
Welcome to WebmasterWorld!
It's likely the reason this does not work is that you are trying to do something that is not supported by HTTP [w3.org].
If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.
Simple answer: Don't try to redirect POSTs - It is a security violation.
Jim
Is there another way of rerouting these requests? I want to have the URLs in question bypass Apache and instead go to the servlets which are being served by JBoss/Tomcat on another port. Is there a way in UNIX to do something like "map /PutMsg to /PutMsg at port X, and don't let Apache handle it first"?
--James