• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Template engines

 
Ranch Hand
Posts: 398
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
sharp shooter, and author
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 1913
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic