Tiles 与 JSP 的比较包括
我们有一个包含数百个 jsps 页面的大型 Web 应用程序。为了避免重复标记块,我们正在考虑使用 apache 磁贴。 语句组合起来似乎很混乱
<t:insertTemplate template="/WEB-INF/templates/xxxxx.jsp">
现在,将和
<%@ include file="xxxxx.jsp"%>
,因此我们正在考虑将所有包含语句转换为 insertTemplates (无论模板是否包含任何tile 语法)
有没有人有过使用tiles 100% for jsp include 的经验?
We have a large web-app with hundreds of jsps pages. To avoid repeating markup up blocks we are considering making use of apache tiles. 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以这样做。然而,主要区别在于
@include
指令是编译时的(因此,在启动期间仅发生一次),而
标签是运行时的(因此,发生在每个请求)。对于您不知道的情况,JSP 已经为此提供了开箱即用的
。现在很明显,当不必要地使用该标签时,它可能会影响性能。
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.