Filtering and modification of Response in Tapestry

Ric 2000 <[email protected]> Sat, 30 Nov 2019 10:38:37 +0100
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAGEHc1X-Dq4vVCj6nDYa1twkwvZD32bre0bX8TGde0inopHHvQ@mail.gmail.com>
--00000000000013b25605988d1d74
Content-Type: text/plain; charset="UTF-8"

Dear all,

I'm struggling on how to filter and modify the response sent to the client
in a Tapestry web application.
I tried first with a RequestFilter contributed to the RequestHandler
service.
The problem occurred when I tried to read the content of the current
response out stream. There are different hints on the internet how to do a
"capture" of this output stream using a custom HttpServletResponseWrapper
and overwriting the write method of the ServletOutputStream, to get the
current content of the outputstream as byte array.

But this is always empty, regardless of how I try to do it.

Can you tell me, what is the right way in Tapestry to do it? Which service
do I have to contribute, in which phase of the request processing the
response is filled and can be read, BEFORE it is send to the client?

Thanks a lot for your suggestions, I really appreciate them!

Best Regards, Ric

--00000000000013b25605988d1d74--