This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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.