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

Incorrect >= 3.1 conditional in JspInitializationListener

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • None
    • Web (Undertow)
    • None

      In JspInitializationListener there is a comment saying

      if the servlet version is 3.1 or higher, setup a ELResolver which allows usage of static fields java.lang.*

      However the conditional following the comment is not testing for "3.1 or higher":

      if (servletContext.getEffectiveMajorVersion() >= 3 && servletContext.getEffectiveMinorVersion() >= 1) {
      

      note that e.g. for 4.0 the expression is false

      To include 4.0, the expression should be something like

      if (servletContext.getEffectiveMajorVersion() > 3 || (servletContext.getEffectiveMajorVersion() == 3 && servletContext.getEffectiveMinorVersion() >= 1)) {
      

      [1] https://github.com/wildfly/wildfly/blob/e8724d5e539ac26b402a5ad10ef3d98839c7497c/undertow/src/main/java/org/wildfly/extension/undertow/deployment/JspInitializationListener.java#L50

              ppalaga Peter Palaga
              ppalaga Peter Palaga
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: