Bugs item #636920, was opened at 2002-11-12 02:32
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=636920&group_id=22866
Category: None
Group: v3.0 Rabbit Hole
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeff Miner (jeff_miner)
Assigned to: Nobody/Anonymous (nobody)
Summary: JSP INCLUDE
Initial Comment:
v 3.0.4
See my previous #594563 which starksm closed.
Inclusion of JSP using RequestDispatcher causes
included content to jump to top of page.
He claims this was fixed, yet the latest, greatest
download (v 3.0.4) exhibits the same behavior.
Do I need to upgrade Jetty separately?
One can flush the out buffer in the JSP before
including, but I need to do this in the object, not in
the JSP. Why doesn't the RequestDispatcher know
how to do this?
----------------------------------------------------------------------
>Comment By: Jeff Miner (jeff_miner)
Date: 2002-11-14 10:01
Message:
Logged In: YES
user_id=592596
Mr. Wilkins,
I don't want to get snippy here, but I do not think there is
any problem with MY code.
A RequestDispatcher that dispatches to a JSP should do
exactly what the <jsp:include> tag does -- no more, no less.
Servlets shouldn't have to know about JSP buffering, etc.
in order to include them properly.
Certainly I could pass the writer around, I can pass the
PageContex around, I can flush the buffers, but these are
workarounds. These are ways for me to avoid the bug.
It is still a bug and should be fixed, not ignored.
FYI - Weblogic has handled this properly since at least
Version 4.5
----------------------------------------------------------------------
Comment By: Greg Wilkins (gregwilkins)
Date: 2002-11-14 01:31
Message:
Logged In: YES
user_id=44062
OK - the problem with your code is that you have decended
back into servlet land to do your include. Poor old
servlets have no idea about what ever
wrappers your JSP (or JSP Engine) has put around the output
stream
and/or writer.
So the servlets are do the dispatch and the new jsp gets the
outputstream and/or writer again from the response and wraps
them
again, without knowing about any buffering already done by
your last JSP.
I think that is why <jsp:include> works, because it knows
about JSP buffering & writers.
You can simply do a flush before your getOutput call, or I
think you can
configure JSPs to do that for you (or not to buffer or
something).
Alternately, you could pass in the JSPs writer to your
getOutput call,
it could wrap the response object and it could return the
writer from
it's getWriter call.
cheers
----------------------------------------------------------------------
Comment By: Jeff Miner (jeff_miner)
Date: 2002-11-13 20:17
Message:
Logged In: YES
user_id=592596
Here is the basic layout of the problem
******Containing Page*******
....<table><tr><td>
<%= myObject.getOutput(request, response) %>
</td></tr></table>...
******* Object ********
public String getOutput(HttpServletRequest request,
HttpServletResponse response) {
RequestDispatcher dispatch =
context.getRequestDispatcher("someJSP.jsp");
try {
dispatch.include(request, response);
} catch(Exception e){}
return "";
*************
I am beginning to understand the extent of the
mishmosh of writers, etc. but it seems to me that the
encapsulating objects should handle these issues.
My point is essentially that a call to
RequestDispatcher.include() really ought to do exactly
the same thing as a <jsp:include>. It doesn't, though.
----------------------------------------------------------------------
Comment By: Greg Wilkins (gregwilkins)
Date: 2002-11-13 00:20
Message:
Logged In: YES
user_id=44062
Can you give us a pair of JSPs that exhibit this problem?
The following URL to the jetty demo site shows that it does
work at least for all the examples that I have.
http://jetty.mortbay.org/jetty/dispatch/include/snoop.jsp
Remember that request dispatching, JSPs, writers and
outputstreams all form a complex little mishmash of
buffering vs flushing (which slows
down performance a lot). You may have some content that
you think has been written to the response before the
include, but it is actually still in a JSP or writer buffer
somewhere (outside the control of Jetty!). I think JSPs do
have some mechanisms for controlling this.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=636920&group_id=22866
-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing
your web site with SSL, click here to get a FREE TRIAL of a Thawte
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development