Spring + Tiles2 - put-attribute from model?

烂漫一生 提交于 2019-12-06 15:07:04

After reading a few different sites (also, thanks for the link Ralph, it gave me a place to start) I have found a solution.

Basically what I needed to do was edit my DTD to use version 2.1 and also to use an expression put-attribute instead of a value put-attribute. Here is the relevant part to the tiles.xml file:

<!DOCTYPE tiles-definitions PUBLIC
   "-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
   "http://tiles.apache.org/dtds/tiles-config_2_1.dtd">

<definition name="user/view" extends="baseLayout">
    <put-attribute name="title" expression="FitterBlog | ${user.username}" />
    <put-attribute name="body" value="/WEB-INF/jsp/user/view.jsp" />
</definition>

See this part of the tiles documentation: Expression Language support

It looks like you need to enable the EL-Support first.

I know this is not a complete solution, but I hope this hint helps to resolve the problem. -- If it helps, please post the solution you found.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!