JSP for Spring MVC视图层的替代方案 [英] Alternatives to JSP for Spring MVC view layer

查看:285
本文介绍了JSP for Spring MVC视图层的替代方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望从头开始创建一个新的应用程序,可能会使用Spring MVC和Spring Web Flow。 Spring Roo创建的项目使用Spring MVC和Web Flow。什么是视图技术的一些很好的替代品,或者是使用Spring和JSTL taglib和jQuery的JSP的方式?

I'm looking to create a new app from scratch and will probably use Spring MVC and possibly Spring Web Flow. The projects created by Spring Roo use Spring MVC and optionally Web Flow. What are some good alternatives for view technology, or is JSP with Spring and JSTL taglibs and jQuery the way to go?

推荐答案

In标准的Java EE API,JSP的唯一替代方法是 Facelets 。到目前为止(2010年), JSF 是唯一的MVC框架本机支持Facelets。

In the standard Java EE API, the only alternative to JSP is Facelets. As far now (2010) JSF is the only MVC framework which natively supports Facelets.

Spring MVC支持开箱即用的JSP,但它有一个可配置的 view resolver ,允许你使用 Facelets 。其他候选者是第三方模板框架,例如 Velocity Freemarker ,以及 Thymeleaf 可以配置为Spring MVC的视图技术。 Spring文档有集成示例使用Velocity和Freemarker。

Spring MVC supports out of the box only JSP, but it has a configurable view resolver which allows you to use Facelets anyway. Other candiates are 3rd party templating frameworks such as Velocity, Freemarker, and Thymeleaf which can be configured as a view technology for Spring MVC. Spring documentation has integration examples with Velocity and Freemarker.

这篇关于JSP for Spring MVC视图层的替代方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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