Using JSTL causes deferredExpression error on change

前端 未结 2 631
灰色年华
灰色年华 2020-12-06 07:02

I recently removed all scriptlets on my project as advised by this post. But now, if I try and make a change to one of my views, I get a deferredExpression error. To get r

相关标签:
2条回答
  • 2020-12-06 07:19

    You most likely have two versions of JSTL (javax.servlet:jstl:). Remove the older version and make sure you update the version everywhere you were using the older one, and you should be good.

    0 讨论(0)
  • 2020-12-06 07:32

    java.lang.NoSuchFieldError: deferredExpression
    at apache.taglibs.standard.tag.common.core.ForEachSupport.release(ForEachSupport.java:212)

    Your classpath is polluted with different JSTL implementation versions. This particular exception means that you've both the jstl-1.2.jar file of JSTL 1.2 and the standard.jar file of JSTL 1.1 or 1.0 in the classpath. This field is introduced in JSTL 1.2 and the ForEachSupport class is present in the both JAR files. Apparently at some point the one of standard.jar is been loaded and used while still having the JSTL 1.2 API in JVM memory.

    The solution is to remove the standard.jar. You don't need it for JSTL 1.2 at all.

    See also:

    • Our JSTL wiki page (to learn about what JARs you need)

    Update: as per the comments, you actually need to remove the jstl-1.2.jar as well, because the Servlet 2.5 compatible version of GAE/Jetty apparently already ships with JSTL 1.1 out the box. This was conflicting with JSTL 1.2. in your webapp.

    0 讨论(0)
提交回复
热议问题