У меня есть контроллер spring, в котором я возвращаю карту с именем "model"; модель содержит некоторый набор значений, но также содержит также ArrayList
. Теперь я возвращаю эту карту в свой JSP, используя JSTL в своем JSP, чтобы получить ArrayList
, он выдает ошибку.
<c:forEach items="${model.result}" var="data" varStatus="status"> <!-- result is my ArrayList -->
<c:out value="${data.url}" /> <!-- here url is data inside my result arraylist -->
</c:forEach>
Созданная ошибка:
root cause
java.lang.NoSuchMethodError: javax.servlet.jsp.PageContext.getELContext()Ljavax/el/ELContext;
at javax.servlet.jsp.jstl.core.LoopTagSupport.unExposeVariables(LoopTagSupport.java:587)
at javax.servlet.jsp.jstl.core.LoopTagSupport.doFinally(LoopTagSupport.java:323)
at jsp_servlet._jsp.__searchsuccess._jsp__tag3(__searchsuccess.java:294)
at jsp_servlet._jsp.__searchsuccess._jspService(__searchsuccess.java:137)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
Он отлично работает на Tomcat Server, но когда я развертываю его на сервере Weblogic (9.2), он дает ошибку. Мои записи в classpath:
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-fileupload-1.1.1.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-io-1.2.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-logging-1.1.1.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/hibernate-validator-4.0.2.GA.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/log4j-1.2.14.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/slf4j-api-1.5.6.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/slf4j-log4j12-1.5.6.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/spring-asm-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/spring-beans-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/spring-context-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/spring-core-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/spring-expression-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/spring-web-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/spring-webmvc-3.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/validation-api-1.0.0.GA.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/log4j-1.2.9.jar"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/servlet-2.3.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre6">
<attributes>
<attribute name="owner.project.facets" value="jst.java"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/jstl-1.2.jar"/>
<classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
Обновление: я удалил jstl-1.2.jar, и теперь я получаю ошибку компиляции:
searchsuccess.jsp:1:5: No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during pa
rsing of the .tld file.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
^----^
searchsuccess.jsp:1:5: No tag library could be found with this URI. Possible causes could be that the URI is incorrect, or that there were errors during pa
rsing of the .tld file.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
^----^
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:298)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:200)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:235)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:394)