Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 3075 invoked from network); 1 Apr 2005 18:51:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Apr 2005 18:51:17 -0000 Received: (qmail 38358 invoked by uid 500); 1 Apr 2005 18:51:10 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 38315 invoked by uid 500); 1 Apr 2005 18:51:10 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 38296 invoked by uid 99); 1 Apr 2005 18:51:10 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of jmikus@gmail.com designates 64.233.184.199 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.199) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 01 Apr 2005 10:51:09 -0800 Received: by wproxy.gmail.com with SMTP id 58so948397wri for ; Fri, 01 Apr 2005 10:51:08 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=PZfMukrmpHVwDaqRN+/pGQ3EZ9LMboXt+lH7Du8SLib1vaReiy8VRzbvuOrvwR3gVo2EQLIxZDV0Ugwk131BkFT6KddR+GvvngKPpshIyFFyNj1f4F5wOwkoAKTm2g8JyuGN9diL3drSYYuOdezSXzd0WxqgAwIFSP/tRdiLfn8= Received: by 10.54.53.27 with SMTP id b27mr1030700wra; Fri, 01 Apr 2005 10:51:07 -0800 (PST) Received: by 10.54.45.24 with HTTP; Fri, 1 Apr 2005 10:51:07 -0800 (PST) Message-ID: <1db115340504011051716d6270@mail.gmail.com> Date: Fri, 1 Apr 2005 10:51:07 -0800 From: "Michael J." Reply-To: "Michael J." To: Tomcat Developers List Subject: Re: Indirect jsp:include does not seem to work In-Reply-To: <424D9577.4010700@joedog.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <1db11534050401093818fa06a8@mail.gmail.com> <1db115340504010944343abd86@mail.gmail.com> <424D9577.4010700@joedog.org> X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Here is what I found at: http://java.sun.com/products/jsp/syntax/1.2/syntaxref1214.html#8828 "The element allows you to include either a static or dynamic resource in a JSP page. The results of including static and dynamic resources are quite different. If the resource is static, its content is included in the calling JSP page. If the resource is dynamic, it acts on a request and sends back a result that is included in the JSP page. When the include action is finished, the JSP container continues processing the remainder of the JSP page." So, what I am doing is perfectly legitimate. I include a dynamic resource (spec does not clarify the type of "resource" or its nesting level). It should return result, to be included in the main page. And "JSP container continues processing the remainder of the JSP page", which Tomcat does not do. It is a bug. Resin works exactly as I expect, and Jetty works too with a proxy JSP page. I have not tried other servers yet. Thank you, Michael. On Apr 1, 2005 10:39 AM, Tim Funk wrote: > You cannot perform a forward inside an include. [Just like you can't set any > headers, including cookies, in an include or a host of other things while in > an include.] > > -Tim > > Michael J. wrote: > > > Hello all, > > > > I have master jsp page, and I try to jsp:include > > page="/strutsAction.do", which forwards to detail jsp page, > > but this does not work. On Tomcat 4.x and 5.x the detail > > page content is included, but further content from the > > master page is stripped out. > > > > According to jsp specs, if I include a resource with > > jsp:include, its content should be included in the page. > > Afaik the spec does not specify nesting level. > > > > I looked in the code. ApplicationDispatcher correctly > > identifies the first request to strutsAction.do as "Path > > Based Include". But when struts action forwards to detail > > jsp, ApplicationDispatcher identifies it as "Path Based > > Forward". doForward() is called instead of doInclude(), and > > ApplicationDispatcher flushes and closes the response > > writer. Thus, Jasper cannot write the rest of master page > > content to writer, and throws > > "org.apache.jasper.JasperException: Stream closed". > > > > Without thinking much, I commented out writer flushing in > > ApplicationDispatcher.doForward(). It seems to work on > > Tomcat 4.1.31, but failed on Tomcat 5.0. Anyway, I am not > > sure that I did a right thing and that all buffers are properly being > > closed now. Would be great if Tomcat devs look into it. > > > > Btw, Jetty does not work as I want, too. BUT: I tried to create a > > "proxy" JSP page, which is included in main JSP page. This proxy page > > includes strutsAction.do, which forwards to real JSP page that I want > > to include (whew!) Jetty works perfectly fine with this proxy JSP > > page! > > > > Also, Resin works fine both with direct including of struts action > > from main page, and with proxy JSP page. > > > > So, I believe that this is a Tomcat bug. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org