Class CmsJspElResolver

java.lang.Object
jakarta.el.ELResolver
org.opencms.jsp.util.CmsJspElResolver

public class CmsJspElResolver extends jakarta.el.ELResolver
This EL resolver is a workaround for performance problems in Jetty when using EE 10.

When using EE 10, a new ImportELResolver is present which tries to interpret EL variables as classes. This fires for all otherwise undefined variables, of which there are many in the Mercury template at runtime, causing a lot of class loading. This leads to a huge slowdown in Jetty, but not in Tomcat. Jetty and Tomcat (currently) use the same JSP engine, which marks standalone top-level identifiers, but only Tomcat's JSP API implementation makes use of that information to optimize the lookup.

This resolver tries to optimize the case where it finds such a marker, effectively disabling the class lookup for standalone identifiers, while preserving it for more complex expressions like ${Foo.bar}.

  • Constructor Details

  • Method Details

    • getCommonPropertyType

      public Class<?> getCommonPropertyType(jakarta.el.ELContext context, Object base)
      Specified by:
      getCommonPropertyType in class jakarta.el.ELResolver
      See Also:
      • ELResolver.getCommonPropertyType(jakarta.el.ELContext, java.lang.Object)
    • getFeatureDescriptors

      public Iterator<FeatureDescriptor> getFeatureDescriptors(jakarta.el.ELContext context, Object base)
      Dummy implementation that does nothing. (this is only needed for Java EE 8 compatibility - in Java EE 8, it actually overrides a method from the parent class.)
      Parameters:
      context - the EL context
      base - the base object
      Returns:
      null
    • getType

      public Class<?> getType(jakarta.el.ELContext context, Object base, Object property)
      Specified by:
      getType in class jakarta.el.ELResolver
      See Also:
      • ELResolver.getType(jakarta.el.ELContext, java.lang.Object, java.lang.Object)
    • getValue

      public Object getValue(jakarta.el.ELContext context, Object base, Object property)
      Resolves a stand-alone identifier from the scoped JSP attributes and ends the resolution, so that the identifier is not looked up as a class name.

      All other cases are left to the standard resolver chain.

      Specified by:
      getValue in class jakarta.el.ELResolver
      See Also:
      • ELResolver.getValue(jakarta.el.ELContext, java.lang.Object, java.lang.Object)
    • isReadOnly

      public boolean isReadOnly(jakarta.el.ELContext context, Object base, Object property)
      Specified by:
      isReadOnly in class jakarta.el.ELResolver
      See Also:
      • ELResolver.isReadOnly(jakarta.el.ELContext, java.lang.Object, java.lang.Object)
    • setValue

      public void setValue(jakarta.el.ELContext context, Object base, Object property, Object value)
      Specified by:
      setValue in class jakarta.el.ELResolver
      See Also:
      • ELResolver.setValue(jakarta.el.ELContext, java.lang.Object, java.lang.Object, java.lang.Object)