eclipse-ee4j / eclipse-ee4j/wasp
The "com.sun.jsp.tldUriToLocationMap" ServletContext attribute is ignored during TLD scanning
- Dominant language
- Java
- Stars
- 8
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
The "com.sun.jsp.tldUriToLocationMap" ServletContext attribute (a.k.a. Constants.JSP_TLD_URI_TO_LOCATION_MAP) is a feature that was introduced in [GLASSFISH-747](https://java.net/jira/browse/GLASSFISH-747 "Make it possible for servlet and JSP containers to share TLD uri-to-location mappings") via [org.apache.jasper.runtime.TldScanner](https://svn.java.net/svn/jsp~svn/tags/javax.servlet.jsp-2.3.3-b02/src/main/java/org/apache/jasper/runtime/TldScanner.java).
Even though the TldScanner#getLocation(String) method correctly retrieves the value of this attribute and populates a map...
```
public String[] getLocation(String uri) throws JasperException {
if (mappings == null) {
// Recovering the map done in onStart.
mappings = (HashMap) ctxt.getAttribute(
Constants.JSP_TLD_URI_TO_LOCATION_MAP);
}
...
}
```
The problem is that the TldScanner#scanTlds() method always re-initializes the map to an empty HashMap which causes TldScanner to forget the value of the attribute:
```
private void scanTlds() throws JasperException {
mappings = new HashMap();
...
}
```
#### Affected Versions
[current]
Contributor guide
Assessment
This issue has not been assessed yet.