rzo1 commented on PR #2844:
URL: https://github.com/apache/tomee/pull/2844#issuecomment-5088905464

   Confirmed the premise against the shipped jar: 
`taglibs-shade-11.0.0-SNAPSHOT.jar`
   declares only the legacy URIs in all 16 TLDs, so `<%@ taglib 
uri="jakarta.tags.core" %>`
   fails at compile time. Aliasing onto the same `TldResourcePath` instances is 
the right
   call and is actually load-bearing — `scanPlatform()` discriminates myfaces 
vs jstl by
   reference identity on `path.getUrl()`.
   
   The ordering claim in the description is backwards, though, and that's the 
main thing
   I want addressed:
   
   - I decompiled `org.apache.jasper.servlet.TldScanner` from tomcat-jasper 
11.0.21.
     `scan()` runs `scanPlatform()` first, and `parseTld()` only registers a URI
     `if (!uriTldResourcePathMap.containsKey(uri))` — first writer wins. 
`scanJspConfig()`
     is stricter still: it checks `containsKey(taglibURI)` and, if present, 
logs a warning
     and skips the mapping entirely.
   
     So a WAR bundling a Jakarta-native JSTL does *not* still win. After this 
change,
     `jakarta.tags.*` is claimed by the container's shaded taglibs-standard-1.2 
TLD for
     every deployment. Concretely, an app that works around TOMEE-4651 today by 
bundling
     `org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.1` in WEB-INF/lib gets its 
TLDs
     silently ignored (that jar isn't in `default.exclusions`, so it's scanned, 
parsed and
     discarded), and an explicit `<jsp-config><taglib>` override in web.xml is 
ignored with
     a warning. That removes the only workaround users currently have.
   
     It's arguably consistent with how the legacy 
`http://java.sun.com/jsp/jstl/*` URIs
     already behave, so I'm not asking you to change the precedence — but it 
needs a note
     in the commit message and ideally a test pinning the intended precedence.
   
   Smaller ones:
   
   - The no-op guard tests map emptiness rather than JSTL presence, so it logs 
spurious
     WARNINGs on a distribution where MyFaces is present but JSTL is not.
   - `permittedTaglibs` is split on `"\n"`, but the value is 
whitespace-separated per the
     TLV contract — split on `\s+`.
   - Nothing asserts `aliasJakartaTagsUris()` is actually wired into the static
     initialiser; unwiring it would leave the test green.
   - Description says seven URIs, the code registers five.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to