Apache Tiles alternatives

≯℡__Kan透↙ 提交于 2020-01-13 07:53:09

问题


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.


回答1:


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/




回答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.




回答3:


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.




回答4:


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.




回答5:


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



来源:https://stackoverflow.com/questions/8565029/apache-tiles-alternatives

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!