You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Robert Tansley <rt...@MIT.EDU> on 2002/08/15 16:23:05 UTC
Possible bug: wrapped requests and jsp:include
Hello,
I've found behaviour which might be a bug in Tomcat 4.0.4. I have a
filter that wraps a request using the "correct way"
(HttpServletRequestWrapper.) The wrapper overrides getParameter (etc.)
The wrapped request then goes to a JSP, "one.jsp". one.jsp includes
another JSP like this:
<jsp:include page="/two.jsp">
<jsp:param name="foo" value="bar" />
</jsp:include>
The problem is that two.jsp only sees the parameters provided by the
wrapper; it can't see the parameter "foo". i.e., in two.jsp:
<%= request.getParameter("foo") %>
is "null". This seems incorrect to me - surely the parameters set via
jsp:param should override any set by the wrapper. I can't find anything
explicit in the spec, though.
It sounds like for jsp:include, Tomcat 4.0.4 is invoking methods on the
internal HttpServletRequest implementation, rather than what I would
expect, which is to use another wrapper around whatever HttpServletRequest
object the JSP/servlet is currently processing.
So is this a bug? I can send a simple webapp demonstrating this to anyone
interested.
Robert Tansley / Hewlett Packard Laboratories / Tel. (+1)617 253 4439
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Possible bug: wrapped requests and jsp:include
Posted by Stephan Orme <st...@panna.org>.
See my earlier post on Tomcat Include behavior ("Do Included CGI's work with
Tomcat? Sent Yesterday at 1:32 pm) - I don't know if this is the same
problem but it sounds a little like it, my speculation is that the include
function won't process included info.
> Hello,
>
> I've found behaviour which might be a bug in Tomcat 4.0.4. I have a
> filter that wraps a request using the "correct way"
> (HttpServletRequestWrapper.) The wrapper overrides getParameter (etc.)
> The wrapped request then goes to a JSP, "one.jsp". one.jsp includes
> another JSP like this:
>
> <jsp:include page="/two.jsp">
> <jsp:param name="foo" value="bar" />
> </jsp:include>
>
> The problem is that two.jsp only sees the parameters provided by the
> wrapper; it can't see the parameter "foo". i.e., in two.jsp:
>
> <%= request.getParameter("foo") %>
>
> is "null". This seems incorrect to me - surely the parameters set via
> jsp:param should override any set by the wrapper. I can't find anything
> explicit in the spec, though.
>
> It sounds like for jsp:include, Tomcat 4.0.4 is invoking methods on the
> internal HttpServletRequest implementation, rather than what I would
> expect, which is to use another wrapper around whatever HttpServletRequest
> object the JSP/servlet is currently processing.
>
> So is this a bug? I can send a simple webapp demonstrating this to anyone
> interested.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>