Tiles vs. JSP includes
We have a large web-app with hundreds of jsps pages. To avoid repeating markup up blocks we are considering making use of apache til开发者_StackOverflow中文版es. Now it seems messy to have a combination of both
<t:insertTemplate template="/WEB-INF/templates/xxxxx.jsp">
and
<%@ include file="xxxxx.jsp"%>
statements so we are considering converting all includes statements to insertTemplates (whether or not the template includes any tile syntax)
Has anyone had any experience with using tiles 100% for jsp includes?
You can do so. The major difference is however that @include directive is compiletime (thus, happens only once during startup) and that <whatever:include> tag is runtime (thus, happens on every request). For the case you didn't know that, JSP already offers <jsp:include> out the box for this.
It must now be obvious that the tag may be a performance hit when unnecessarily used.
加载中,请稍侯......
精彩评论