Is it possible to use Tiles2 with Struts 1?
I've followed the instruction available at the migration guide http://tiles.apache.org/migration/index.html
But when I try to access my actions, I get this error:
org.apache.tiles.template.NoSuchAttributeException: Attribute 'body' not found.
I have in struts-config.xml:
<controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"
maxFileSize="10M" tempDir="/tmp" />
<plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
</plug-in>
And tiles-defs.xml
<definition name="mainTemplate" template="/common/templates/mainTemplate.jsp" />
<definition name="index" extends="mainTemplate">
<put-attribute name="body" type="string" value="/views/index/index.jsp" />
</definition>
Make the following changes in your struts-config.xml
<controller processorClass=”org.apache.struts.tiles2.TilesRequestProcessor”/>
<plug-in className=”org.apache.struts.tiles2.TilesPlugin” >
Find the sources for the Tiles2 plugin here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With