Greetings for the day, I was just trying to find out pros and cons of using Apache Tiles framework. Please let me know your valuable suggestions, comments, inputs regarding the same.
Apache Tiles is a template composition framework. Tiles was originally built to simplify the development of web application user interfaces, but it is no longer restricted to the JavaEE web environment. Tiles allows authors to define page fragments which can be assembled into a complete page at runtime.
So Apache Tiles has retired. I'm using Spring MVC framework and JSP. What alternatives are there? I saw Sitemesh, but it is a decorator and I need a template framework.
Advantage of Tiles support in Spring MVCReusability: We can reuse a single component in multiple pages like header and footer components. Centralized control: We can control the layout of the page by a single template page only.
(similar to this)
With Tiles, it seems that when I have 100 actions I need to creates 100 jsp files and create 100 definitions in tiles.xml - true, unfortunately
This is not true. And a common lingering misconception about tiles.
Such boilerplate configuration is a hang-up from tiles-1 days. It really isn't necessary with tiles-2 when wildcards were introduced, and especially with tiles-3 along with the OptionsRenderer.
Here's a tutorial that will help you with
I'm been using Apache Tiles for a non-commercial project and I'm becoming less enthusiastic with it every week. But this may be caused by very basic documentation, too few examples (and no examples on advanced topics) and quite a small community.
Besides, I'd recommend you to look at those resources:
Better alternative to Apache Tiles - With Tiles, it seems that when I have 100 actions I need to creates 100 jsp files and create 100 definitions in tiles.xml - true, unfortunately
http://blog.springsource.org/2012/10/30/spring-mvc-from-jsp-and-tiles-to-thymeleaf/ - The Apache Tiles approach is similar to custom tags and therefore has same pros and cons. There is some activity on the Apache Tiles project but it is definitely not as vibrant as ThymeLeaf
To sum up - advantages:
composite
) views out of basic views, UI reusedisadvantages:
composite view
instead of decorator
- in my private opinion the decorator pattern is more flexible - you may define variables, slots, attributes, etc. in the very end of the request handling, whereas in composite view
you need to focus on when you define the attribute (all attributes of a sub-view have to be defined before it's rendered - attributes overriding is more difficult)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With