Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-72889

ClassCastException for EL in custom tag files

Details

    • 1

    Description

      Using EL expression in custom tag file throws exception :

      java.lang.ClassCastException: com.liferay.taglib.servlet.PageContextWrapper cannot be cast to org.apache.jasper.runtime.PageContextImpl
      at org.apache.jasper.runtime.JspContextWrapper.getELContext(JspContextWrapper.java:327)
      at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1012)
      at org.apache.jsp.tag.web.demotags.sum_tag.doTag(sum_tag:74)
      at org.apache.jsp.index_jsp._jspx_meth_d_sum_0(index_jsp:76)

      index.jsp 

      <%@taglib tagdir="/WEB-INF/tags/demotags" prefix="d" %>
      Hello <d:sum a="1" b="4" />
      

      sum.tag 

      <%@tag pageEncoding="UTF-8" isELIgnored="false" body-content="empty" %>
      <%@attribute name="a" type="java.lang.Long" %>
      <%@attribute name="b" type="java.lang.Long" %>
      and the result is ${a+b}.

       

      Attachments

        1. showtag.war
          3 kB
        2. showtag.zip
          6 kB

        Activity

          People

            support-lep@liferay.com SE Support
            ra100 Rasto Rehak (Inactive)
            Kiyoshi Lee Kiyoshi Lee
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              5 years, 43 weeks, 5 days ago

              Packages

                Version Package