4
我们将在我们的JSP/spring-project中为某种模板引擎使用JSTL和自定义JSTL标签。自定义JSTL标签与主体
有没有一种方法来创建一个标签,看起来像这样类似:
<div id="site">
<div id="header">Some title</div>
<div id="navigation"> SOME DYNAMIC CONTENT HERE </div>
<div id="content"> ${content} </div>
<div id="footer"></div>
</div>
,并使用它像这样:
<mytags:template>
<h1>Title</h1>
<p>My content!</p>
</mytags:template>
即使用自定义JSTL标签体内的内容。 ..
这工作:
<mytags:template content="some content... not HTML" />
但在我们的案例中并不是非常有用。
不好的一面是它更冗长。 – 2010-02-23 05:15:15