I am writing a Spring MVC application and looking for a way to do layouts in views. The only option that i see is Apache Tiles, which i have used before and know how painful it is to maintain its configuration.
Are there any good alternatives? I looked at SiteMesh and Spring Surf both seem to be dormant.
Apache Tiles™ 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.
Tiles is used to create reusable presentation components. With Tiles, we first define a base layout with different sections after that we define which jsp page should fill in the corresponding regions in an exteranl configuration file. The same layout can be reused any number of times by specifying different jsp pages.
Spring provides functionality for integrating with the Apache Tiles framework. With the help of spring tiles support, we can easily manage the layout of the Spring MVC application.
I faced the same dilemma about a month ago. I have been a seasoned developer using apache tiles, and I wanted to try something different.
I did some research and found that Spring MVC has some integration with freemarker and sitemesh. I decided to give both a shot.
Tiles seems to have the most active community.
You can also try a pure velocity implementation.
To sum up, my project ended up reverting back to tiles. Tiles is a robust templating framework, and once you understand it's powers, I will find it hard to find a good replacement. Also, if you are already skilled in apache tiles, I find the benifits of switching frameworks (if any) do not justify the learning curve required to picking up sitemesh/freemarker
http://www.sitemesh.org/overview.html
http://freemarker.sourceforge.net/
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