Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-3100

ClassCastException in JSPs where spring-web tags and jstl tags are used

XMLWordPrintable

      Following JSP with spring tags

      <%@ page contentType="text/html;charset=UTF-8" language="java" %>

      <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
      <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>

      <html>
      <head><title>Simple jsp page</title></head>
      <body>

      <c:set var="hasError" value="${param.hasError}" />
      <c:set var="msg" value="${param.msg}" />

      <c:if test="${param.hasError=='true'}">
      Message: <spring:message text="${param.msg}"/>
      </c:if>

      </body>
      </html>
      breaks following error
      ERROR [org.springframework.web.servlet.tags.MessageTag] (default task-1) org.apache.taglibs.standard.lang.jstl.ImplicitObjects cannot be cast to javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects: java.lang.ClassCastException: org.apache.taglibs.standard.lang.jstl.ImplicitObjects cannot be cast to javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects
      at javax.servlet.jsp.el.ImplicitObjectELResolver$ImplicitObjects.getImplicitObjects(ImplicitObjectELResolver.java:608) [jboss-jsp-api_2.3_spec-1.0.0.Final.jar:1.0.0.Final]
      at javax.servlet.jsp.el.ImplicitObjectELResolver.getValue(ImplicitObjectELResolver.java:169) [jboss-jsp-api_2.3_spec-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.jasper.el.JasperELResolver.getValue(JasperELResolver.java:95) [jastow-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.jasper.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:32) [jastow-1.0.0.Final.jar:1.0.0.Final]
      at org.apache.jasper.el.ELResolverImpl.getValue(ELResolverImpl.java:78) [jastow-1.0.0.Final.jar:1.0.0.Final]
      at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:116) [javax.el-3.0.0.jar:3.0.0]
      at com.sun.el.parser.AstValue.getBase(AstValue.java:151) [javax.el-3.0.0.jar:3.0.0]
      at com.sun.el.parser.AstValue.getValue(AstValue.java:200) [javax.el-3.0.0.jar:3.0.0]

      There are two jars (jboss-jsp-api_2.3_spec-1.0.0.Final.jar and jboss-jstl-api_1.2_spec-1.0.4.Final.jar) that are incompatible with each other due to a bug – both are storing an object in the same place, but the objects are not compatible.

      The result is that a jsp page cannot contain both JSTL and Spring tags, or it will get that error.

              smcgowan@redhat.com Shelly McGowan (Inactive)
              avijra_jira abhishek vijra (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: