In my project we have to store user's currently displayed page content(html code) in DB. This is useful for CSR to see user's current page. I'm planning to use servletFilter's concept but not sure how to get the html code as a stream/string inorder to store in DB. I appreciate any suggestions/comments?