Sitemesh或Tiles [英] Sitemesh or Tiles

查看:101
本文介绍了Sitemesh或Tiles的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从事Web应用程序的设计,因为它将是一个大型应用程序,因此无法回复jsp include功能,因此必须使用其他解决方案,为此我们提出了Tiles和Sitemesh。

Working on the design of a web-application and since it will be a large application so can not reply on jsp include feature so have to use some other solution and for that we came up with Tiles and Sitemesh.

我们对这两者都不熟悉,所以我们非常感谢社区的任何见解。有关其他信息,我们将使用Struts2.x作为我们的邮件MVC框架,其中Spring用于其他层(商业)

We are new to both of them so any insight from the community will be much appreciated.For additional information we will use Struts2.x as our mail MVC framework with Spring for the other layer(Business)

哪个选项更好,因为应用程序必须处理大量内容和频繁的UI更改

Which option is better since the application have to do with lots of content and frequent UI changes

推荐答案

根据我的个人经验,我建议使用Tiles2:与Struts2轻松而干净的集成,允许您沿着各种模板重用单个组件,模板组合可以根据您的需要进行复杂化(支持嵌套,模式继承,组件引用等)等。作为一个负面的点,我会提到XML配置,对于大型项目来说可能意味着千米ic XML文件。无论如何,这可以很容易地避免分割配置文件(即一般模板的文件,以及每个模块的视图的单独文件),但是,你最终还是有很多XML配置文件......

From my personal experience, I would recommend Tiles2: Easy and clean integration with Struts2, allows you to reuse avery single component along various templates, the templates composition can be as complex as you want (supports nesting, pattern inheritance, components referencce, etc), etc. As a negative point, I would mention the XML configuration, which for large project can imply kilometric XML files. Anyway, this can be easily avoided segmenting the config files (i.e a file for general templates, and a separate file for the views if each module), but still, you end up having lots of XML config files...

使用Tiles2的另一点是,它是一个活跃的项目(最后一个版本于2010年6月发布),而Sitemesh项目似乎有点放弃(上次发布于2009年3月,见过< a href =http://wiki.sitemesh.org/wiki/display/sitemesh/Download =noreferrer>这里)。

Another point for the use of Tiles2, is that it's an active project (last release published on June 2010), while Sitemesh project seems a little abandoned (last release on March 2009 as seen here).

无论如何,要检查不同的视点(复合视图与装饰模式),你可以看看这里那里,看看哪种方法更适合你的要求。

Anyway, to check the different points of view (Composite View vs. Decorator pattern), you could take a look here and there, and see which approach will fit better your requirements.

这篇关于Sitemesh或Tiles的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆