---
title: "spring mvc REST"
author: "喧嚣求静"
date: "2011-11-28T13:24:53Z"
tags: ["MVC", "REST", "Spring"]
categories: ["Web前端"]
slug: "spring-mvc-rest"
draft: false
lastmod: "2011-11-28T13:43:44Z"
id: 1280722
url: "https://913.iteye.com/blog/1280722"
---

[REST概念](http://zh.wikipedia.org/wiki/REST)
[spring mvc REST](http://hi.baidu.com/software_one/blog/item/c2634c34eaef51d6a3cc2bdc.html)
Spring 3.0 MVC 使用以下技术支持REST
**1.在Controller 里能获取到来自HTTP请求的所有方法，包括REST支持的：GET,PUT,DELETE,POST.**
**2.新注解@PathVariable使用控制器能处理参数化的URL(带表达式的参数)**
**3.<form:form>表单标签,在配置了过滤器HiddenHttpMethodFilter后，可以提交PUT,DELETE方法。
**
4.使用spring的多视图支持，可以返回多种数据类型如xml,json,atom,rss,jsp,etc
5.使用ContentNegotiatingViewResolver,可以依据不同的后缀自动选择合适的视频解析器。
6.视图导向可统一通过使用新注解@ResponseBody,或者实现了HttpMethodConverter接口的类，来自HTTP请求中的数据，在Controller里他们能转换处理为JAVA对象
7.使用RestTemplate模板技术，能简单处理REST