• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Template engines

 
vasu maj
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have been using Web Macro (http://wiki.webmacro.org) for some time now and I am a believer.
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
Wayne Hefner
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
ben munoz
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jason Hunter has devoted several chapters in Java Servlet Programming (O'Reilly) to template engines.
Template Engines Listing can be found here half way down the page: http://www.servlets.com/tools/index.html
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic