I want to modify every HTML page I have in my Spring application. The reason behind this is I want to include a piece of JavaScript code on each page.
Unfortunately, Sitemesh can't help me out here (or at least I think it can't) because Ajax requests would also have to be affected by this JavaScript, and my Ajax requests are explicitly excluded from being decorated.
So my idea was to tamper with HttpServletResponse using a Filter in Spring, but I'm stuck at actually accessing the generated content and modifying it.