在Apache Tiles定义文件中配置元标记



如何在Apache Tiles定义文件中创建元标记?对于每个页面,我都可以创建一个唯一的标题标签,但是如何创建元标记?

我的标题定义如下。

    <put-attribute name="title" value="Random Books"></put-attribute>

如何创建下面显示的元标记?

    <meta name="keywords" content="Novels,Books" />

我似乎找不到在线创建元标记的任何示例。

我能够通过将其添加到JSP默认页面

来完成此操作。
<tiles:insertAttribute name="metaKeyword" ignore="true" /> 

在apache图块定义文件中使用以下内容

<put-attribute name="metaKeyword" expression="&lt;meta name=&quot;keywords&quot; content=&quot;Novels,Books&quot; /&gt;"></put-attribute>

肯定有一种更好/更正确的方法来执行此操作?

也许这样做是正确的方法?它对我有用...

<put-attribute name="metaKeywords" value="Novels,Books"/>
<meta name="keywords" content="<tiles:insertAttribute name="metaKeywords" ignore="true"/>"/>

最新更新