I have a servlet that includes the request manager of another servlet.
The incoming servlet sets the headers that I would like to read in the included servlet. Therefore, I pass the custom HTTPResponse object in the include () method, which captures all feedback activity from the servlet.
The problem is that the headers are not customizable in my custom answer. I ran debug and looked at what looks like Tomcat, which terminates my custom response object with its own response object. When calling setHeader, this class is carried over and never extends to my custom response object.
I think Tomcat does this to protect the client from headers set in the wrong place. The funny thing is that the same approach works as I expected in Jetty.
It has been a long time since I took up the servlet seriously, so I'm struggling a bit. I am trying to understand how to read response headers from a servlet that are called through dispatcher.include ().
Cliff source
share