请推荐一种在 Spring MVC 3 应用程序中使用的视图技术
我正在寻找哪种视图技术被认为是 Spring MVC 3.0 的最佳方法,它灵活、可维护并允许多种渲染技术,例如 HTML、PDF 等...
我们正在寻求使用 Spring MVC 开发下一个 Web 应用程序3.0 并已选择 Hibernate 来实现持久性,但仍在尝试确定哪种是最合适的视图技术。
我们需要支持 PDF 报告,但很可能会使用 iText 编写这些报告。
是否有任何 Maven 原型可以设置具有持久性和视图技术的推荐应用程序?
Spring 示例使用了从 JSTL 到 Apache Tiles 的一系列不同技术,自从 2003 年迁移到 .NET 以来,我们过去只使用过 JSP,现在又回到了 Java。
I'm looking for what view technology would be considered the best approach for Spring MVC 3.0 which is flexible, maintainable and allows multiple rendering technologies such as HTML, PDF etc...
We're looking to develop our next web application using Spring MVC 3.0 and have settled on Hibernate for persistence but are still trying to decide which is the most appropriate view technology.
We will require support for PDF reports but would most likely write these using iText.
Are there any maven archtypes which would setup a recommended application complete with persistence and view technology?
The spring samples use a bunch of different technologies from JSTL to Apache Tiles, we've only ever used JSP in the past since we moved to .NET in 2003 and are moving back to Java now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果您使用最新版本,那么使用 JSP 确实没有什么问题。您当然可以选择 Freemarker、Velocity 和其他很酷的查看器,但如果您的整个团队已经习惯了 JSP,那么您在采用新技术时需要考虑项目截止日期和所有学习曲线。如果有意义的话,当然,学习新东西也没什么坏处。
就我而言,我使用 JSP 和 Sitemesh 作为模板。我使用 JSP/Strut Tiles 组合很长一段时间,但我发现该模板太具有侵入性,而 Sitemesh 对我来说似乎更加无缝,因为它不会用一些 Tile 特定的自定义标签使我的实际 JSP 文件变得混乱。
There's really nothing wrong with using JSP, if you use the most recent version. You can certainly choose Freemarker, Velocity and other cool viewer, but if your entire team is already comfortable dealing with JSP, you need to take account of your project deadline and all the learning curves when taking on a new technology. If it makes sense, sure, it doesn't hurt to learn another new thing.
In my case, I use JSP with Sitemesh as my template. I used JSP/Strut Tiles combo for quite awhile but I find the template to be too intrusive, Sitemesh seems to be more seamless to me because it doesn't clutter my actual JSP files with some Tile specific custom tags.
以下是一些。
这里是讨论与视图技术集成的文档
我们目前正在使用 Jsp 2.1 和 spring webmvc 3.0x 以及 google appengine 上的 apache 磁贴,它很好地满足了我们的目的。
Below are a few.
Here is a doc that talks about integration with view technologies
We are currently using Jsp 2.1 with spring webmvc 3.0x with apache tiles on google appengine and it servers our purpose quite well.
Apache Velocity 怎么样?
这是我所知道的最流行的模板引擎。但希望得到更多建议。
更新:
Freemarker 是另一个
来源
How about Apache Velocity
That's the most popular template engine I know of. Would like to get more suggestions though.
Update:
Freemarker is another
Source
如果我是你,我现在会坚持使用 jsp。如果您决定某些流程需要其他内容,您可以在 Spring 中混合搭配您的视图。例如,如果您计划使用任何 ajax 样式处理,则需要使用不同的视图类型。
If I were you, I would stick with jsps for now. You can mix and match your views in Spring if you decide certain flows will require something else. For example, you will need to use different view types if you plan to use any ajax style processing.
JSP:易于使用和维护。
其他还有 Apache Velocity、Freemarker。
我个人推荐JSP
JSP : easy to use and maintain.
Other are Apache Velocity, Freemarker.
I personally would recommend JSP