Custom JSTL tags with body
Posted
by Mickel
on Stack Overflow
See other posts from Stack Overflow
or by Mickel
Published on 2009-10-20T09:46:04Z
Indexed on
2010/03/21
14:01 UTC
Read the original article
Hit count: 435
Hi,
We are going to use JSTL and custom JSTL-tags for some sort of template-engine in our JSP/spring-project.
Is there a way to create a tag that looks similar like this:
<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>
and use it like this:
<mytags:template>
<h1>Title</h1>
<p>My content!</p>
</mytags:template>
i.e. use body-content inside a custom JSTL-tag...
This works:
<mytags:template content="some content... not HTML" />
but is not very useful in our case.
© Stack Overflow or respective owner