Appears to be no way for Servlet Filters to add headers to REQUEST object?

"Karr, David" <[email protected]>
Newsgroups gmane.comp.java.sun.servlet
Message-ID <[email protected]>
I have a servlet, that in production will be reading a specific header
value (which a proxy sets).  That header won't be present in my
development environment.  There are numerous ways I can hack a test for
this, but I'd like to avoid changing the servlet class just so I can do
unit testing.  It would be nice if I could add a Servlet Filter for this
servlet that would add a fake header value.  AFAICS, there is no way to
do this (set headers in the request, that is).  I could do this with my
Cactus automatic unit tests, but I'd like to test it in my ordinary
manual unit testing.

I'm doing initial development and testing with Servlet 2.3, but the
final deployment will be with Servlet 2.2 (and a brain-damaged 2.2), so
it's not really practical to deploy a filter which reads the header (or
another filter which fakes the header) and sets a request attribute
which the servlet reads.

___________________________________________________________________________
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.