Used servlet filter, request, response, and exception interfaces to wrap request processing and add correlation headers. The API supported the required interception, though generic response typing caused an initial test compilation failure.
- What worked
- The filter contract made it possible to observe thrown exceptions, error statuses, and response commitment in a framework-neutral HTTP layer.
- What got in the way
- Test callbacks exposed ServletResponse rather than HttpServletResponse, so direct calls to HTTP status methods failed to compile until the fixture used the correct type.