Group,

Jsp's can be used to implement a simple templating mechanism using
jsp:include...

<html>
<head><title>some title</title>
<LINK REL="stylesheet" TYPE="text/css" HREF="/css/stylesheet.css">
<jsp:include page="include/script.html" flush="true" />
</head>
<body MARGINHEIGHT="0" MARGINWIDTH="0"  leftmargin="0" RIGHTMARGIN="0"
topmargin="0">
<jsp:include page="include/header.html" flush="true"/>
<jsp:include page="include/tabnav.jsp" flush="true">
       <jsp:param name="tab" value="4">
       <jsp:param name="link" value="yes">
</jsp:include>
<jsp:include page="mycontent.html" flush="true" />
<jsp:include page="include/footer.html" flush="true" />
</body>
</html>

The original j2ee blueprint, petstore application used template tag's and a
jsp template page, a jsp screendefinition page, and java code for the
url/mapping, and a jsp type II controler. Recent releases of petstore use
tag's and xml definitions for the template, the screendefinition, and
url/mapping, and the type II controller is now a servlet. This is somewhat
nicer, since your don't have to recompile the code when the web front
changes.

What I don't understand, though, is why use the j2ee blueprint templating
mechanism anyway, since the jsp:include tag is so flexible. We can still use
a type II controller with the simple template above. Of course, this means
we need a template for every page, but I mean these are pretty simple
templates. Why go through the complexity of a "procedural" templating
mechanism when jsp's already have it. And if a better templating mechanism
is required, why not include the template tag's in jsp 2.4?

Does anybody has some insight on the "why" of the j2ee blueprint templating
mechanism? Or for that matter, any procedural templating mechanism?

Regards,

the elepantwalker



Reply via email to