I have spent that past four days tracking down why a very large Spring JSP was unable to compile. Even letting it compile overnight was to no avail.
The solution turned out to be to use jsp:forward statements to break up the 2,200 line jsp into chunks with an average size of about 240 lines. Even that didn't completely work because one of the "chunks" was in turn using jsp:forward to an 850 line jsp. When I also broke that jsp into chunks, at last the jsp compiled in about twenty seconds, which is fine because once it compiles it's very quick.
The problem in my case only appeared when I converted a Spring web application from IBM WSADS 5.12 and Websphere 5.1, to IBM RAD7 and Websphere 6.1. I also upgraded Spring from 1.2.8 to 2.0.5, upgraded JSP from 1.2 to 2.0, and upgraded Servlet 2.3 to 2.4, but those changes had nothing to do with solving or causing the problem. The problem (I think) was IBM Rational Applications Developer 7 and Websphere 6.1 not being able to compile a large JSP that has a lot of Spring tags in it.
Now that I know about this, it's easy to work around it by using jsp:include to break up a large JSP that has a lot of Spring tags in it. Here's the chunkified jsp:
Code:
<%@ taglib prefix="spring" uri="/WEB-INF/spring.tld" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="/WEB-INF/jsp/ChunkerNetworkTelForm/chunk01_networkTelForm.jsp" flush="true" />
<jsp:include page="/WEB-INF/jsp/ChunkerNetworkTelForm/chunk02_networkTelForm.jsp" flush="true" />
<jsp:include page="/WEB-INF/jsp/ChunkerNetworkTelForm/chunk03_networkTelForm.jsp" flush="true" />
<jsp:include page="/WEB-INF/jsp/ChunkerNetworkTelForm/chunk04_networkTelForm.jsp" flush="true" />
<jsp:include page="/WEB-INF/jsp/ChunkerNetworkTelForm/chunk04_networkTelForm.jsp" flush="true" />