i see , so i use HttpServletRequestWrapper in the exact same way : charArrayWriter.write(wrapper.toString().substring(0,wrapper.toString().indexOf("</body>")-1)); and the wrapper.toString() method will give me the HTML code .
thank you vary much ! i will try to run this code . Sharon
i was wondering , is there any other way to process the output html of servlet beside filters ? I am trying to avoid changing the source servlets.
Actually, filters act as a decorator pattern; you can place them before or after the service method. You have to write the filter, and change the deployment descriptor (so you do have to alter the descriptor); you never have to change the actual servlet code. Hope this helps.