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

calling/accessing static fields/methods from jstl expressions are not working in liferay

    Details

      Description

      EL-3.0, which is part of Servlet-Spec-3.1, supports calling static fields from a jstl expression. But it seems does not working in liferay.

      for ex:

      // java class
      public final class FooConst {
      
          public static final String HELLO_CONST = "Constant says >> hello";
      
          public static String sayHello() {
              return "Method says >> hello";
          }
      }
      

       

      <%-- jsp file --%>
      
      <%@ page import="com.liferay.demo.model.FooConst" %>
      
      <div>
      Method Call : ${FooConst.sayHello()} <br/>
      Field Call : ${FooConst.HELLO_CONST} <br/>
      </div>
      

      Expected:

      Method Call : Method says >> hello
      Field Call : Constant says >> hello
      

      Actual:

      Method Call : 
      Field Call : 
      

       

      The jsp is working correctly when deployed on JbossEAP-7 (tested in 7.4.1) and tomcat-9 (tested in 9.43) as a servlet-application.

      Also attaching a sample project ("hello-portlet.zip"), to reproduce the issue.

        Attachments

          Activity

            People

            Assignee:
            support-lep@liferay.com SE Support
            Reporter:
            jjohn Jishin John
            Participants of an Issue:
            Recent user:
            Jishin John
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Days since last comment:
              14 weeks ago

                Packages

                Version Package