Can I put @RequestHeader on a model object property? I.e.
class MyModel {
String ua;
public void setUa(@RequestHeader("User-Agent") String ua) {
this.ua = ua;
}
}
This works with @RequestParam, but seems to have no effect when I use @RequestHeader. Am I missing something? And, if this isn't supported, is there some reason why?
You can do this only in controller methods. Not model objects. Check the documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With