You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/11/28 00:19:57 UTC
DO NOT REPLY [Bug 12787] -
request.getRequestURI() returns garbage when included in some tags
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12787>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12787
request.getRequestURI() returns garbage when included in some tags
------- Additional Comments From tmoore@blackboard.com 2002-11-27 23:19 -------
I believe I have found the cause of this bug. It is related to the MsgAjp
class in the JK server. So this bug probably only appears when using an AJP
connection to Tomcat.
First of all, it does not only occur when using tag extensions. Any time the
page is flushed before request.getRequestURI is called, you will see this bug.
I am attaching a very minimal JSP that demonstrates this problem. Call it
normally, and the request URI is fine. Call it with a "flush" request
parameter, and the request URI has been changed to a fragment of the filler
text at the top of the file.
If you pop open the source for org.apache.jk.common.HandlerRequest (I'm working
with Tomcat 4.1.12) and go to line 433, you can see where the request URI is
initially set, using the msg.getBytes method. On MsgAjp, however, the getBytes
(MessageBytes) method does NOT clone it's buffer, it simply gives the
MessageBytes object a reference to the buffer. That buffer is then reused when
flushing the output stream, causing this problem.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>