0

I am implementing paging support using custom tag. I decided to use JSP-based tag because there is more formatting than any heavy logic. But this is not the main story. The trouble is that JSTL forEach simply doesn't work at my .tag file and throws java.lang.NoSuchFieldError: deferredExpression .Even this code is throwing exception when I'm using my tag at JSP:

<%@tag description="paging support for employee" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<div>
    <div>
        <c:forEach var="i" begin="1" end="20" step="1" varStatus ="status">
            <c:out value="${i}" /> 
        </c:forEach>
    </div>
</div>

Also in my previous project i met this exception while was mixing together struts tags and forEach tag in a single JSP. I couldn't find out what was it, but handled it through replacing forEach by similar struts tag iterate. But this time I need exactly forEach because of it's attribute "step". Any ideas ?

Dmitry Kankalovich
  • 553
  • 2
  • 8
  • 19
  • 1
    Maybe you have conflicting JARs in your classpath? Does the accepted answer to this question apply to your problem? http://stackoverflow.com/questions/7837576/using-jstl-causes-deferredexpression-error-on-change – GriffeyDog Feb 03 '12 at 15:17
  • Well this problem is the exact one which I faced first time. I will try to find these conflicting jars. Maybe someone know it already for the next config: struts1 (from netbeans 7.1) + spring 2.5.6 (from netbeans 7.1) + jstl-1.2.jar under WEB-INF/lib. IDE netbeans 7.1 . Servlet container is Tomcat 7. – Dmitry Kankalovich Feb 03 '12 at 15:28
  • **UPDATED** found jstl 1.0.2 under struts1 library. – Dmitry Kankalovich Feb 03 '12 at 15:33

0 Answers0