How do I store HttpServletResponse?-->Caching the response
In a servlet within the doPost I need to save the response before giving it to the client.
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RequestDispatcher requestDispatcher = getServletContext().getRequestDispatcher("/jsp/Header.jsp");
requestDispatcher.include(request, response);
requestDispatcher = getServletContext().getRequestDispatcher("/jsp/ResultadoB_squeda.jsp");
requestDispatcher.include(request, response);
requestDispatcher = getServletContext().getRequestDispatcher("/jsp/Footer.jsp");
requestDispatcher.include(request, response);
//Here is were I want to store the content of the response
The idea is to store WebPages in Html (after all the processing done by the server) to then retrieve it.... This is the cache for a Web application
I know that de HttpServletResponse has a PrintWriter, and I know that the PrintWriter has a buffer but this buffer is protected and can't be readed or accesed......so what I can do to solve this problem (I'm interested just in the content of the HttpServletResponse)...also HttpServletResponse is not a serializable object.
See that I need to store the page after some server work...If you see I include JSP pages that are proccesed so in the response there is only the HTML result....
Any idea could help...

