Map @CookieValue, @RequestHeader etc. to POJO in Spring Controller -


i have bunch of params in controller , want map of them separate pojo keep readability. there @cookievalue, @requestheader need evaluate , aim solution map them pojo. how?

i saw possible solution on blog doesn't work, variable stays null.

controller:

@requestmapping(path = mapping_language + "/category", produces = mediatype.text_html_value) @responsebody public string category(categoryviewresolvemodel model) {     dosomething(); } 

and pojo this:

public class categoryviewresolvemodel {  private string pagelayoutcookievalue;  public categoryviewresolvemodel() { }  public categoryviewresolvemodel(         @cookievalue(value = "some_cookie", required = false) string pagelayoutcookievalue) {     this.pagelayoutcookievalue = pagelayoutcookievalue; }  ... other requestparams, pathvariables etc. } 

according documentation it's not possible @cookievalue, , @requestheader.

this annotation supported annotated handler methods in servlet , portlet environments.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -