Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.1
-
None
-
None
Description
Sitemesh plugin's struts-plugin.xml uses incorrect filter for both freemarker and velocity
<struts>
<bean class="org.apache.struts2.sitemesh.FreeMarkerTemplatePageFilter" static="true" optional="true"/>
<bean class="org.apache.struts2.sitemesh.VelocityTemplatePageFilter" static="true" optional="true"/>
</struts>
should be
<struts>
<bean class="org.apache.struts2.sitemesh.FreeMarkerPageFilter" static="true" optional="true"/>
<bean class="org.apache.struts2.sitemesh.VelocityPageFilter" static="true" optional="true"/>
</struts>
By changing this some problem arrises when either or both of those statically injected files (FreeMarkerPageFilter and VelocityPageFilter) doesn't exists in the classpath. It causes exception, cause Guice does static injection when creating the container, such that during building the container (using ContainerBuilder) the error could not be detected resulting in codes in XmlConfigurationProvider's register method pretty much have no effect.
A way to simulate this is to use create a webapp using struts2-archetype-starter and try out the application.