Apache Tiles 类似框架,但没有 xml 配置
Apache Tiles 框架很棒。但我讨厌的一件事是我必须维护大型 xml 配置文件,即使已分区,我只是讨厌将编程和表示信息放在配置文件中。
我只是不明白? struts/tiles 作者是如何产生这种将如此多的表示逻辑放入配置文件中的强迫倾向的?
我正在寻找像 Tiles 这样的框架,但没有该死的 XML 配置。任何人都可以帮助列出基于与 Tiles 竞争的 Composite View 模型的布局框架。
Apache Tiles framework is great. But one thing I hate about it is the large xml configuration file that I have to maintain, even if partitioned, I just hate placing programmatic and presentation information inside configuration files.
I just don't get it? How did struts/tiles authors reach this obsessive tendency to place so much presentation logic inside configuration files?
I'm searching for a framework like Tiles but without the bloody XML configuration. Anyone can help in listing layout frameworks based on the Composite View model that compete with Tiles.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
网站网。 Sitemesh 是一个类似的模板页面系统,但无需 xml 即可完成。如果您有一个或两个反复使用的主模板,则这尤其好,无需为每个模板创建 xml 条目。它目前是 Grails 中的默认模板系统。 Sitemesh 3 有一些不错的补充,但截至撰写本文时仍处于测试阶段,文档几乎为零。它使用装饰器模式,如所有tiles与sitemesh的比较中所示。
或者,如果您愿意放弃 jsp,您可以尝试 JSF 2.0,它具有非常令人印象深刻的模板功能,并且不需要 xml。与服务器端代码的 JSF 组件模型一起肯定有助于减少重复代码。 (作为奖励,JSF 2.0 的 Primefaces 组件库是最令人印象深刻的组件/小部件集之一。)
Sitemesh. Sitemesh is a similar system for templating pages but can be done without xml. This is especially nice if you have one or two main templates that you keep using over and over, no need to create an xml entry for each and every one. It's currently the default templating system in Grails. Sitemesh 3 has some nice additions but as of the time of this writing is stuck in beta with almost zero documentation. It uses the decorator pattern as seen in all of the comparison of tiles vs sitemesh.
Alternatively if you are willing to give up on jsp, you can give a go at JSF 2.0 which has very impressive templating capabilities with no xml needed. That along with the JSF component model for server side code will certainly assist in cutting down repetitive code. (As a bonus the Primefaces component library for JSF 2.0 is one of the most impressive component/widget sets around.)
您是否考虑过 Apache Wicket?
Have you considered Apache Wicket?
Apache Tiles 可以在不使用 XML 的情况下进行配置。
Apache Tiles can be configured without using XML.
stripes 提供的布局标签非常棒。完全不需要配置并且易于理解和开始使用。它们在某种程度上是如此伟大,以至于我认为它们应该从 stripes 中提取出来,并作为一个单独的项目在自己的 github 项目空间上进行维护。
The layout tags provided by stripes are excellent. Require no configuration at all and easy to comprehend and start using. They are so great to an extent that I think they should be extracted from stripes and maintained as a separate project on there own github project space.
您可以在 这篇文章。
这个想法是用您自己的
TilesDefinitionsConfig
实现DefinitionsFactory
并调用tilesConfigurer.setDefinitionsFactoryClass(TilesDefinitionsConfig.class);
。您的新配置包含布局定义。You can see a Tiles example with Java config (no XML) in this SO post.
The idea is to implement the
DefinitionsFactory
with aTilesDefinitionsConfig
of your own and calltilesConfigurer.setDefinitionsFactoryClass(TilesDefinitionsConfig.class);
. Your new config contains the layout definitions.