File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Question on Facelets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSF
Bookmark "Question on Facelets" Watch "Question on Facelets" New topic
Author

Question on Facelets

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9398
    
    2

Guys,

Are Facelets View Definition language something similiar to tiles templating that we do in Struts?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Bart Kummel
author
Ranch Hand

Joined: Nov 30, 2007
Posts: 81
Hi,

Facelets does have a templating mechanism, both on page level and on component level. I do not have experience with Tiles myself, so I can't tell you how Facelets' templating mechanism compares to Tiles.

Best regards,
Bart


SCJP 1.4 | SCJD 1.6 | Visit my website | Author of the book Apache MyFaces 1.2 Web Application Development
Tom Fulton
Ranch Hand

Joined: Mar 30, 2006
Posts: 95
It's pretty similar conceptually, with one major difference: Tiles has the ability to "inherit" layouts, while Facelets does not. Apart from that, they can be used in much the same way...create an overall layout, plug in content pages, etc. One difference is that way in which parameters are passed around...in Tiles, you have the tiles scope, but in Facelets you have the ability to specify parameters that are passed through. Again, conceptually similar, with a difference in technique.

Facelets also has something that does not really exist in Tiles: composition components. Suppose you notice a recurring visual effect on a number of pages (such as columns in a data table, or rows in an input form). You can create a component that captures that common structure, re-use it wherever necessary, passing it parameters to tune it to a particular use.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16096
    
  21

I have tried to use Tiles in Struts. I have tried to use Tiles in JSF. I've always given up. To me, Tiles requires too much work to define everything properly. YMMV.

The Facelets component-building feature is quite useful. I've got several projects where I've used it to good effect. One of them has a lot of pages that have a small scrollable "help control" in them, and I built the "help control" as a component that gets passed the help topic ID as a parameter..


Customer surveys are for companies who didn't pay proper attention to begin with.
 
GeeCON Prague 2014
 
subject: Question on Facelets