I have a spring controller in which I am returning a Map named \"model\"; model contains some set of values but importantly also contains an ArrayList
. Now I am
As per the stacktrace,
java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
at javax.servlet.jsp.jstl.core.LoopTagSupport.unExposeVariables(LoopTagSupport.java:587)
the JSTL
tag is expecting the method PageContext#getELContext(). This method was introduced in JSP 2.1. This exception thus suggests that you are using JSTL 1.2, while your container doesn't support JSP 2.1 or that you have littered your runtime classpath with servletcontainer specific JSP libraries of a container which doesn't support JSP 2.1. The runtime classpath covers among others the webapp's /WEB-INF/lib
folder and Java's JRE/lib
and JRE/lib/ext
folders .
You should never put servletcontainer specific libraries in those folders, such as jsp-api.jar
, servlet-api.jar
, el-api.jar
, j2ee.jar
, javaee.jar
, etc..etc.. Those files which you usually see in /lib
folder of the servletcontainer itself. E.g. Tomcat/lib
. It makes your webapp unportable to the target servletcontainer. The target servletcontainer where you're running this webapp has those libraries already. If you did this to overcome compilation errors on JSP/Servlet packages, then you should have solved it differently. See also How do I import the javax.servlet API in my Eclipse project?
Update: as per your update, you're using Weblogic 9.2 which is a Servlet 2.4 / JSP 2.0 container. It does not support JSP 2.1 / JSTL 1.2 at all. You need to remove the JSTL 1.2 library. If I am not mistaken, Weblogic ships with JSTL 1.1 already. Otherwise you need to include it in the classpath (the /WEB-INF/lib
folder) yourself. You can find a JSTL 1.1 download link in our JSTL wiki page.