title: WebRequest on @RequestBody object
body: <p>In Spring MVC. I'm able to use the <em>WebRequest</em> as a parameter that will automatically be set (along with other things such as <em>Locale</em> etc.).</p>
  
  <p>I'm also using @RequestBody to pass in a JSON object which describes what and how data should be fetched.</p>
  
  <p>Is it possible to get Spring to automatically set the <em>WebRequest</em> directly on the <em>@RequestBody</em> object <em>EntriesRequestDTO</em> (I would make a <em>WebRequest</em> field on <em>EntriesRequestDTO</em>). This would allow me to hide some complexity since I often need to get an attribute from <em>WebRequest</em>.</p>
  
  <pre><code> @RequestMapping(value = "/entries", method = { RequestMethod.POST })
      public EntriesDTO getEntries(@RequestBody EntriesRequestDTO request, WebRequest webRequest){
     ...
  }
  </code></pre>