You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* <p class="changed_added_2_2">
* If a <code><context-param></code> with the param name equal to the value of
* {@link #WEBAPP_CONTRACTS_DIRECTORY_PARAM_NAME} exists, the runtime must interpret its value as a path, relative to
* the web app root, where resource library contracts are to be located. This param value must not start with a "/",
* though it may contain "/" characters. If no such <code><context-param></code> exists, or its value is invalid,
* the value "contracts", without the quotes, must be used by the runtime as the value.
* </p>
Impl throws exception because it does not start with /
Caused by: java.lang.IllegalArgumentException: Path [foo] does not start with a "/" character
at org.apache.catalina.core.ApplicationContext.getResourcePaths(ApplicationContext.java:571)
at org.apache.catalina.core.ApplicationContextFacade.getResourcePaths(ApplicationContextFacade.java:183)
at org.apache.catalina.core.StandardContext$NoPluggabilityServletContext.getResourcePaths(StandardContext.java:6447)
at com.sun.faces.config.initfacescontext.ServletContextAdapter.getResourcePaths(ServletContextAdapter.java:248)
at com.sun.faces.config.WebConfiguration.discoverResourceLibraryContracts(WebConfiguration.java:401)
at com.sun.faces.config.WebConfiguration.doPostBringupActions(WebConfiguration.java:389)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:227)
... 30 more
This was earlier discovered and pointed out in #5118
I also noticed that these pieces of logic in CompositionHandler and IncludeHandler do not take into account that the path can be a relative path and incorrectly assume them always to be the absolute path.
if (path.startsWith(webConfig.getOptionValue(WebConfiguration.WebContextInitParameter.WebAppContractsDirectory))) {
throw new TagAttributeException(tag, src, "Invalid src, contract resources cannot be accessed this way : " + path);
}
Discovered while working on #5328
Spec says it may not start with
/
When set as such in web.xml
Impl throws exception because it does not start with
/
This was earlier discovered and pointed out in #5118
But in hindsight not fully fixed because the code is not DRY wrt obtaining contracts param. The same code was copypasted in several other classes.
The text was updated successfully, but these errors were encountered: