Apache Tiles alternatives
Asked Answered
C

5

12

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.

Creep answered 19/12, 2011 at 17:26 Comment(0)
S
10

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/

Squill answered 19/12, 2011 at 18:40 Comment(0)
S
2

Tiles and Sitemesh are very different in what they are designed for.

  • Tiles is used as a part of your application designed to use tiles.
  • Sitemash is designed as a filter in front of one or several already existing applications. Where you want to change the output of the applications (for example (a very easy task) replace the logo or add an extra menu option).

On the other hand I do not see why have so much xml. You have to write one xml block for each page to define which layout it needs. (If you still configure a list of files containing the tiles configurations then have a look at `org.springframework.web.servlet.view.tiles2.TilesConfigurer".)

If you want to get rid even of these files, then, perhaps, you should think more of extending tiles than using an other framework.

Supposititious answered 20/12, 2011 at 10:20 Comment(0)
L
1

IMO SiteMesh and Tiles are both pretty good approaches, although newer Tiles releases add a lot of untapped power--it's more than a simple templating mechanism.

If you're finding maintenance an issue I'd consider wrapping it up in a thin layer of abstraction using either a DSL or light GUI, either can make a big difference.

Look answered 19/12, 2011 at 18:42 Comment(0)
L
0

You could use phpj

Its easy to use, comes with examples. You may use it for view templates or generate your html content any way you want to.

Ladybug answered 23/7, 2013 at 15:38 Comment(0)
P
0

Although I've no experience with it personally, here's another alternative: https://code.google.com/p/commentit/

Prestige answered 8/8, 2014 at 20:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.