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: 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: Are you worried about your web server security? Click here for a FREE Thawte Apache SSL Guide and answer your Apache SSL security needs: http://www.gothawte.com/rd523.html _______________________________________________ Jboss-development mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-development