Features of Spring Web MVC

21.1.1 Features of Spring Web MVC

Spring Web Flow

Spring Web Flow (SWF) aims to be the best solution for the management of web application page flow.

SWF integrates with existing frameworks like Spring MVC and JSF, in both Servlet and Portlet environments. If you have a business process (or processes) that would benefit from a conversational model as opposed to a purely request model, then SWF may be the solution.

SWF allows you to capture logical page flows as self-contained modules that are reusable in different situations, and as such is ideal for building web application modules that guide the user through controlled navigations that drive business processes.

For more information about SWF, consult the Spring Web Flow website.

Spring’s web module includes many unique web support features:

  • Clear separation of roles. Each role — controller, validator, command object, form object, model object, DispatcherServlet, handler mapping, view resolver, and so on — can be fulfilled by a specialized object.
  • Powerful and straightforward configuration of both framework and application classes as JavaBeans. This configuration capability includes easy referencing across contexts, such as from web controllers to business objects and validators.
  • Adaptability, non-intrusiveness, and flexibility. Define any controller method signature you need, possibly using one of the parameter annotations (such as @RequestParam, @RequestHeader, @PathVariable, and more) for a given scenario.
  • Reusable business code, no need for duplication. Use existing business objects as command or form objects instead of mirroring them to extend a particular framework base class.
  • Customizable binding and validation. Type mismatches as application-level validation errors that keep the offending value, localized date and number binding, and so on instead of String-only form objects with manual parsing and conversion to business objects.
  • Customizable handler mapping and view resolution. Handler mapping and view resolution strategies range from simple URL-based configuration, to sophisticated, purpose-built resolution strategies. Spring is more flexible than web MVC frameworks that mandate a particular technique.
  • Flexible model transfer. Model transfer with a name/value Map supports easy integration with any view technology.
  • Customizable locale, time zone and theme resolution, support for JSPs with or without Spring tag library, support for JSTL, support for Velocity without the need for extra bridges, and so on.
  • A simple yet powerful JSP tag library known as the Spring tag library that provides support for features such as data binding and themes. The custom tags allow for maximum flexibility in terms of markup code. For information on the tag library descriptor, see the appendix entitled Chapter 40, spring.tld
  • A JSP form tag library, introduced in Spring 2.0, that makes writing forms in JSP pages much easier. For information on the tag library descriptor, see the appendix entitled Chapter 41, spring-form.tld
  • Beans whose lifecycle is scoped to the current HTTP request or HTTP Session. This is not a specific feature of Spring MVC itself, but rather of theWebApplicationContext container(s) that Spring MVC uses. These bean scopes are described in Section 6.5.4, “Request, session, and global session scopes”

http://docs.spring.io/spring/docs/4.2.0.RC1/spring-framework-reference/htmlsingle/#mvc-features

 

时间: 2024-12-26 18:29:34

Features of Spring Web MVC的相关文章

在Spring Web MVC环境下使用Dojo

开始之前 关于本教程 本教程主要探讨如何在 Spring Web MVC 环境中使用 Dojo 的 widget,示例应用使用了 dojox.data.DataGrid,一个 Dojo Toolkit 1.2 新增的 widget . Dojo widget 与服务器交换数据的格式有很多种,本教程主要探讨在 Ajax 编程中比较常用的 JSON 格式的数据.本教程示例演示了 dojox.data.DataGrid 组件与 Spring Web MVC 控制器之间交换数据的细节,其中,服务器端使用

Spring Boot——2分钟构建spring web mvc REST风格HelloWorld

Spring Boot--2分钟构建spring web mvc REST风格HelloWorld 之前有一篇<5分钟构建spring web mvc REST风格HelloWorld>介绍了普通方式开发spring web mvc web service.接下来看看使用spring boot如何快速构建一个.   Spring Boot使我们更容易去创建基于Spring的独立和产品级的可以"即时运行"的应用和服务.支持约定大于配置,目的是尽可能快地构建和运行Spring应

Spring Web MVC(二)

五大核心组件 Controller 处理器控制器 MVC补充 AbstractController 和 WebContentGenerator 其它的简单控制器 MultiActionController 命令控制器command controllers重点 AbstractCommandController AbstractFormController SimpleFormController AbstractWizardFormController ViewResolver和View 视图与

maven spring web mvc pom 基本配置

xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">4.0.0com.hjmyapp0.0.1-SNAPSHOTwar <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>

《Spring 5 官方文档》18. Web MVC 框架(八)

18.8.5 LocaleChangeInterceptor 您可以通过添加LocaleChangeInterceptor到其中一个处理程序映射来启用更改区域设置(请参见第18.4节"处理程序映射").它将检测请求中的一个参数并更改区域设置.它呼吁setLocale()在LocaleResolver上下文中也存在.以下示例显示,对包含*.view名为的参数的所有资源的调用siteLanguage现在将更改语言环境.因此,例如,对以下URL的请求http://www.sf.net/hom

《Spring 5 官方文档》18. Web MVC 框架(六)

18.4处理程序映射 在以前的Spring版本中,用户需要HandlerMapping在Web应用程序上下文中定义一个或多个 bean,以将传入的Web请求映射到适当的处理程序.通过引入注释控制器,您通常不需要这样做,因为它RequestMappingHandlerMapping会@RequestMapping自动在所有@Controllerbean 上查找 注释.但是,请记住,所有HandlerMapping扩展的类AbstractHandlerMapping都具有以下可用于自定义行为的属性:

《Spring 5 官方文档》18. Web MVC 框架(九)

18.13.2 ModelMap(ModelAndView) 该ModelMap班本质上是一种荣耀Map,可以使补充说,是要显示(或上)一个对象View坚持一个共同的命名约定.考虑以下Controller实现; 注意对象被添加到ModelAndView没有指定的任何关联的名称. public class DisplayShoppingCartController implements Controller { public ModelAndView handleRequest(HttpServl

《Spring 5 官方文档》18. Web MVC 框架(七)

18.5.4 ContentNegotiatingViewResolver 这ContentNegotiatingViewResolver不会解析视图本身,而是委托给其他视图解析器,选择类似于客户端请求的表示的视图.客户端可以从服务器请求表示方式存在两种策略: 通常通过在URI中使用不同的文件扩展名为每个资源使用不同的URI.例如,URI http://www.example.com/users/fred.pdf请求用户fred的PDF表示,并http://www.example.com/use

spring mvc-Spring web MVC问题,麻烦大神们帮忙看看哪里出错了?很急很急!!!!谢谢啦

问题描述 Spring web MVC问题,麻烦大神们帮忙看看哪里出错了?很急很急!!!!谢谢啦 报错日志: java.lang.IllegalArgumentException at org.springframework.asm.ClassReader.(Unknown Source) at org.springframework.asm.ClassReader.(Unknown Source) at org.springframework.asm.ClassReader.(Unknown