标签:cep value framework logs ping pac ann val blog
在控制器方法中,通过类似 RequestHeader(value="Accept-Lanaguage") String lan 可以获取请求头信息。
控制器方法:
package com.tiekui.springmvc.handlers; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; @Controller public class RequestHeaderTest { @RequestMapping("testRequestHeader") public String testRequestHeader(@RequestHeader(value="Accept-Language") String language) { System.out.println(language); return "success"; } }
视图内容
<a href="testRequestHeader">TestRequestHeader-video9</a>
SpringMVC(十) RequestMapping RequestHeader注解
标签:cep value framework logs ping pac ann val blog
原文地址:http://www.cnblogs.com/zhoutiekui/p/6308958.html