Hi, I have read somewhere that template engines are better than using JSPs( Less cumbersome, neater, concise and to the point). Do you guys have any experience using them ? What do you say?Simon, what is your opinion?
Hi there, In my opinion, it depends on the content that you are trying to generate. If your content is fairly static then a template engine (maybe based upon XLST for example) may be the way to go. If, on the other hand, your content is very dynamic (e.g. large tables of data), then they may not be appropriate. Another option of course is to use JSPs and templates in combination. This is particularly useful for : (a) delivery to multiple channels - for example a web browser and a mobile device where the screens are different sizes. By using a template, you can say which "parts" of the UI you would like to display on each client. (b) pages that share a common look and feel - you could define leftnav, topnav and common header areas for example. The Struts project has a templates taglib for JSPs although ... take a look at http://jakarta.apache.org/struts/api/org/apache/struts/taglib/t emplate/package-summary.html#package_description What does everybody else think? Simon ------------------ Simon Brown Author of Professional JSP 2nd Edition [This message has been edited by Simon Brown (edited July 17, 2001).]
Al Lopez<BR>PNC Financial Services Group<BR>Senior Programmer/Analyst & Technology Officer
sharp shooter, and author
Joined: May 10, 2000
Al, For those of us that don't know about WebMacro ... could you give us a quick intro? Thanks Simon ------------------ Simon Brown Author of Professional JSP 2nd Edition [This message has been edited by Simon Brown (edited July 17, 2001).]
Using the templates in combination with the jsp is a powerful feature to allow dynamic generation of entire websites while keeping the consistent feel throughout. Also by using the templates you can define the look and feel using the templates in one file. This allows a change to the one file that will update the feel of the whole site without modifying the jsp pages that will generate the content.