Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
8.0.2
-
None
Description
MyFaces has a feature to automatically serve all views without extension/suffix:
index.xhtml -> index
this is implemented in the AbstractFacesInitializer and can be activated via:
org.apache.myfaces.AUTOMATIC_EXTENSIONLESS_MAPPING = true
This currently throws the following exception:
java.lang.UnsupportedOperationException: Section 4.4 of the Servlet 3.0 specification does not permit this method to be called from a ServletContextListener that was not defined in web.xml, a web-fragment.xml file nor annotated with @WebListener
at org.apache.catalina.core.StandardContext$NoPluggabilityServletContext.getServletRegistrations(StandardContext.java:6579)
at org.apache.myfaces.webapp.AbstractFacesInitializer.getFacesServletRegistration(AbstractFacesInitializer.java:834)
at org.apache.myfaces.webapp.AbstractFacesInitializer.initAutomaticExtensionlessMapping(AbstractFacesInitializer.java:820)
at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:246)
at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:103)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4683)
It actually works without TomEE on plain Tomcat, as MyFaces adds the StartupServletContextListener via his own web-fragment in the myfaces-impl jar.
This is not scanned in TomEE and the StartupServletContextListener is added manually in:
Could we fix it by fake it in Tomcat somehow, that the listener was added via XML?