I've replicated something similar on Tomcat 10.1.34 (and also 9.0.98). Steps
1 - Download and unzip Tomcat 10.1.34
2 - Create file "webapps/ROOT/include.jsp" with contents "<h1>I've been
included!</h1>"
3 - Edit "webapps/ROOT/index.jsp" adding the following code at the bottom
of the JSP
```
<%
String bigString = "<span style=\"color: red;\">This is a big
string</span>";
for (int i = 0; i < 100; i++) {
bigString += "<span style=\"display: none;\">This is a big
string</span>";
}
request.setAttribute("bigString", bigString);
request.setAttribute("length", bigString.length());
%>
<p>isCommitted=<%= response.isCommitted() %></p>
<p>${bigString}</p>
<p>length=${length/1024}</p>
<p>isCommitted=<%= response.isCommitted() %></p>
<p>Before Include</p>
<jsp:include page="include.jsp"/>
<p>After Include</p>
```
3 - Start Tomcat (using Java 17)
4 - Load page http://localhost:8080/
5 - The text "I've been included!" is missing
One thing I've noticed, if I change the loop from 100 to 10 the included
content is included. Then if I change it back to 100 without restarting,
the included content is still included.