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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -