Hello,
I have been having some problems debugging a set of three JSPs that use <jsp:include
page=""/> tags within a while loop in Tomcat 4.1.29.
Just so I don't send my actual code to the list, I will create an identical example
using Persons.jsp, Person.jsp, and PhoneNumber.jsp to demonstrate my problem.
---Snippet from Persons.jsp---
<jsp:useBean id="persons" class="Collection" scope="request"/>
<%
Iterator iter = persons.iterator();
while( iter.hasNext() ) {
request.setAttribute( "person", (PersonBean)iter.next() );
%>
<!-- Display people -->
<jsp:include page="Person.jsp"/>
<%
}
%>
---Snippet from Person.jsp---
<jsp:useBean id="person" class="my.package.PersonBean" scope="request"/>
<%
Iterator phone = person.getPhoneNumbers();
while( phone.hasNext() ) {
request.setAttribute( "phone", (PhoneBean)phone.next() );
%>
<jsp:include page="PhoneNumber.jsp"/>
<%
}
%>
---Snippet from PhoneNumber.jsp---
<jsp:useBean id="phone" class="my.package.PhoneBean" scope="request"/>
<span class="somecss">
<jsp:getProperty name="phone" property="phoneNumber"/>
<!-- ...other attributes and html gunk... -->
</span>
-------
Now.... What happens is, when I make a request to the main page "Persons.jsp", no
exceptions are thrown, and the page begins to render correctly. But what happens is
the content is cut off at some random point during the iteration of people/phone
numbers. It differs every time you request the page, and from viewing the source, it
is clear that the output stream has just been closed at some random point while
writing the response.
I haven't been able to find any other postings like this describing any such similar
problems, and at this point, I am unaware of any way to fix this problem except by
rewriting the pages to not use the <jsp:include> tags within the while loop. I know
that this exact same thing works under Caucho Resin 2.1, and only since we ported to
Tomcat have we started to see this problem.
Any information or insight would be greatly appreciated.
Thanks!
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]