Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-1506

Sitemesh plugin's struts-plugin.xml uses incorrect filter for both freemarker and velocity

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.0.2
    • 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.

      Attachments

        Activity

          People

            mrdon Donald J. Brown
            tm_jee tm_jee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: