2
例如,我想将当前请求中的cookie的值绑定到下面的pojo。如何将cookie值绑定到Spring MVC中的pojo字段?
@RequestMapping(path="/", method= GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> handleTheRequest(Foo foo){
return blah;
}
public class Foo{
private string cookieValue;
//Other fun fields
public void setCookieValue(String value){
this.cookieValue = value;
}
public string getCookieValue(){
return cookieValue;
}
}