Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tiles vs. JSP includes

Tags:

include

jsp

tiles

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?

like image 392
plodder Avatar asked Mar 31 '10 23:03

plodder


1 Answers

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.

like image 121
BalusC Avatar answered Sep 30 '22 02:09

BalusC