如何在Struts 1中使用Tiles2

Dan*_*ier 5 java tiles tiles2 struts-1

是否可以在Struts 1中使用Tiles2?

我已按照迁移指南http://tiles.apache.org/migration/index.html上的说明进行操作

但是当我尝试访问我的操作时,我收到此错误:

org.apache.tiles.template.NoSuchAttributeException: Attribute 'body' not found.
Run Code Online (Sandbox Code Playgroud)

我有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>
Run Code Online (Sandbox Code Playgroud)

和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>
Run Code Online (Sandbox Code Playgroud)

sum*_*rma 1

在struts-config.xml中进行以下更改

\n\n
<controller processorClass=\xe2\x80\x9dorg.apache.struts.tiles2.TilesRequestProcessor\xe2\x80\x9d/>\n<plug-in className=\xe2\x80\x9dorg.apache.struts.tiles2.TilesPlugin\xe2\x80\x9d >\n
Run Code Online (Sandbox Code Playgroud)\n\n

在此处查找 Tiles2 插件的源代码

\n