File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Template engines Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Template engines" Watch "Template engines" New topic
Author

Template engines

vasu maj
Ranch Hand

Joined: Jul 12, 2001
Posts: 395
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?


What a wonderful world!
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
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

Joined: Jul 17, 2001
Posts: 1
I have been using Web Macro (http://wiki.webmacro.org) for some time now and I am a believer.


Al Lopez<BR>PNC Financial Services Group<BR>Senior Programmer/Analyst & Technology Officer
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
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

Joined: Jul 13, 2001
Posts: 13
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

Joined: Jul 24, 2001
Posts: 5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Template engines