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)
在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 >\nRun Code Online (Sandbox Code Playgroud)\n\n在此处查找 Tiles2 插件的源代码。
\n| 归档时间: |
|
| 查看次数: |
1380 次 |
| 最近记录: |