Announcement Announcement Module
Collapse
No announcement yet.
Tomcat 6.0.24 Duplicate Variable issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tomcat 6.0.24 Duplicate Variable issue

    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.

  • #2
    The same for me

    Just bumped into the same issue (;
    Seems it is due to a restriction in the JSP 1.1 Specification that disallows
    using the same value for an id attribute more than once in a single JSP page.

    As a work-around, some people recommend using the following in web.xml if there is 2.4 as in my case:

    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">
    ...
    </webapp>
    but I have not tried it yet.

    Comment


    • #3
      Seems the solution is 6.0.25 version. Tomcat 6.0.25
      Checked - it works.

      Comment

      Working...
      X