tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Cruikshank <a...@epitonic.com>
Subject Re: Problem losing post data during and after jsp:include
Date Fri, 10 Dec 1999 19:00:27 GMT
At 10:46 AM 12/10/99 +0100, you wrote:
>Hans Bergsten a écrit :
>
> > Alex Cruikshank wrote:
> > >
> > > It seems that the RequestDispatcher is clobbering the post data in the
> > > Request object while processing a jsp:include.   I don't think this is
> > > expected behavior.  The code in RequestDispatcher.include() method:
> > > [...]
> >
> > Have you found through testing that the POST data disappears? I looked at
> > this about a month ago and at first thought the same as you. But on further
> > investigation it turned out to actually work. It was far from obvious
> > (I don't remember the details) but I'm pretty sure I verified that it was
> > okay.
> >
> > If you have tested it and it's in fact is a bug, I stand corrected and will
> > see if I can fix it (during the weekend or next week, if no one beats me
> > to it).


Unless, my system (RedHat 6.0, PIII, w/o apache) behaves differently from 
yours, if you install the files testincluder.jsp and testincluded.jsp and 
request http://foo.com/testincluder.jsp, you'll get no request parameters 
at all three points (before, during, and after the include).

If you request http://foo.com/testincluder.jsp?problem=no+problem you'll 
get the parameter name "problem" at all three points.

If you hit the button at the bottom of the page, you'll get "problem" 
before the include, and no parameters during and after the include.

thanks - alex


testincluder.jsp
------------------------------------------------------------------------
<%@ page import="java.util.*" %>
These are the request parameters before the include:<BR>
<% Enumeration e = request.getParameterNames();
while (e.hasMoreElements() )
{
         out.println( e.nextElement() + "<BR>" );
}
%><br>
<% System.err.println( "Before include" ); %>

<jsp:include page="testincluded.jsp" flush="true" /><br>

<% System.err.println( "After include" ); %>

These are the request parameters after the include:<BR>
<% e = request.getParameterNames();
while (e.hasMoreElements() )
{
         out.println( e.nextElement() + "<BR>" );
}
%>

<br><br><br>
<form action="testincluder.jsp" method="post">
<input type=hidden name="problem" value="no problem with post data">
<input type=submit>
</form>
------------------------------------------------------------------------




testincluded.jsp:
------------------------------------------------------------------------
<%@ page import="java.util.Enumeration" %>
These are the request parameters in the included file:<BR>
<% Enumeration e = request.getParameterNames();
while (e.hasMoreElements() )
{
         out.println( e.nextElement() + "<BR>" );
}
%><br>
------------------------------------------------------------------------




Mime
View raw message