nibertj
Mar 8th, 2010, 12:29 PM
Recently upgraded to Tomcat 6.0.24 (64 bit). Our application previously successfully ran on Tomcat 6.0.20 (using Spring 2.5) . After the Tomcat upgrade, jsp pages started to fail. After digging through the code (too many includes)- we finally determined that we had nested <spring:bind> tags. And this was causing the error. Re-factored the jsp pages to eliminate nested <spring:bind> tags - and the application kept working. Does anyone know why these nested tags worked in earlier versions of Tomcat and not in the 6.0.24 version?
Sample Code (Nested <spring:bind>):
<spring:bind path="publishForm.phoneNumber">
<c:out value="${status.value}" />
<c:if test="${ testValue != 0 }">
<spring:bind path="publishForm.phoneType">
<c:out value="${status.value}"/>
</spring:bind>
</c:if>
</spring:bind>
The fix was to make a pageScope variable and then do the if:
<spring:bind path="publishForm.phoneNumber">
<c:out value="${status.value}" />
<%--
Have to set a page scope because Tomcat 6.0.24 will not
permit nested spring:bind tags....This way we can still do
the if phone number has some value get its type call below.
--%>
<c:set var="testValue" scope="page" value="${status.value}"/>
</spring:bind>
<c:if test="${ testValue != 0 }">
<spring:bind path="publishForm..phoneType">
<c:out value="${status.value}"/>
</spring:bind>
</c:if>
Thanks.
Sample Code (Nested <spring:bind>):
<spring:bind path="publishForm.phoneNumber">
<c:out value="${status.value}" />
<c:if test="${ testValue != 0 }">
<spring:bind path="publishForm.phoneType">
<c:out value="${status.value}"/>
</spring:bind>
</c:if>
</spring:bind>
The fix was to make a pageScope variable and then do the if:
<spring:bind path="publishForm.phoneNumber">
<c:out value="${status.value}" />
<%--
Have to set a page scope because Tomcat 6.0.24 will not
permit nested spring:bind tags....This way we can still do
the if phone number has some value get its type call below.
--%>
<c:set var="testValue" scope="page" value="${status.value}"/>
</spring:bind>
<c:if test="${ testValue != 0 }">
<spring:bind path="publishForm..phoneType">
<c:out value="${status.value}"/>
</spring:bind>
</c:if>
Thanks.