How do you add a http protocol header value in HttpServletRequest at a Filter,before call request.getHeader()
and get the header value?
You can find the hooks in HttpServletRequestWrapper.
[Edited to include a link to an example]
Here you can find a fine example.
HttpServletRequest objects are read-only. You cannot modify them. But you can definitely extend their functionality by employing a decorator pattern and add mutability in the extended class. Take a look at the following post:
http://wilddiary.com/adding-custom-headers-java-httpservletrequest/
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