在使用strts2和tiles2结合时一直提示:org.apache.tiles.TilesException: Attribute 'title' not found.
找不到对应的属性,花了不少时间,网上有不少解决方案:
一个是将配置文件中:http://struts.apache.org/dtds/struts-2.0.dtd
修改为:http://tiles.apache.org/dtds/tiles-config_2_0.dtd
修改之后无果,不过这个也是需要修改的地方
将其放入action中
<package name="tilestest" extends="tiles-default">
<action name="login">
<result type="tiles">showWelcomePage</result>
</action>
</package>
然后通过action执行成功。
原来如果要直接打开页面的话需要再增加一个jsp文件,然后在其中添加:
<tiles:insertDefinition name="showWelcomePage" />
这样即可。