You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Don Brown (JIRA)" <ji...@apache.org> on 2006/11/16 09:35:57 UTC

[jira] Resolved: (WW-1506) Sitemesh plugin's struts-plugin.xml uses incorrect filter for both freemarker and velocity

     [ http://issues.apache.org/struts/browse/WW-1506?page=all ]

Don Brown resolved WW-1506.
---------------------------

    Resolution: Fixed
      Assignee: Don Brown

Fixed.  The key was to determine why the dependencies, VelocityManager in this case, were being loaded at all since they would throw a no class def error as soon as they were touched.  The solution was to call the getDeclaredConstructors() method on them before they are loaded into the container, which forces the error to be thrown.  Then, it was a matter of handling the case in the bean selector when a defined extension point wasn't there.  Oh, and the sitemesh plugin had to have the manager dependencies declared optional, then be made to complain loudly when used but without their dependencies set.

> Sitemesh plugin's struts-plugin.xml uses incorrect filter for both freemarker and velocity
> ------------------------------------------------------------------------------------------
>
>                 Key: WW-1506
>                 URL: http://issues.apache.org/struts/browse/WW-1506
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.0.1
>            Reporter: tm_jee
>         Assigned To: Don Brown
>             Fix For: 2.0.2
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira