Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1810

Provide valid Servlet major version responses if undertow-servlet has been transformed to use jakarta.* Servlet APIs

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 2.2.3.Final
    • None
    • Servlet
    • None

      This is a proposal for a kind of hack.

      Assume undertow-servlet has been bytecode transformed to use jakarta servlet APIs instead of the javax it was compiled against. This transformation could happen either during its own build or later, as WildFly Preview's wildfly-preview-feature-pack does when it provisions artifacts using javax.

      Such an undertow will work fine as a EE 9 Servlet implementation, except it reports the wrong servlet major version as the code hard codes '4'. A server using this cannot pass the EE 9 TCK.

      Proposed hack is to add a static initializer to the DeploymentInfo class that provides that '4'. Look at the java.lang.Package for one of the Servlet API classes it already uses. If the package name starts with 'jakarta' it knows it has been transformed and should report '5' not '4'.

              bstansbe@redhat.com Brian Stansberry
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: