java - How to best use JTidy with a Spring servlet container? -
I have a Java servlet container using the Spring Framework, all the things generated by JSP, using spring to wire Pages are ready. The resultant HTML sent to the user is not as good as I would like. I want to send the HTML correctly before sending the client browser.
I will set it to work in development and stop production; This is a winner in my vision, because this will give me more ease in maintenance.
How to clean that work in the spring?
Why do you want to do this? The best part is to remove all the white spaces and compact the HTML as much as possible. Users appear to submit HTML, and mostly do not care about its composition and indentation. If you want users to see HTML, they can use an HTML makeup on HTML on their machine.
More info
The JTD is the one you can apply on your JSPS. Just add the following lines to jtidy jar and web.xml for web-INF / Lib:
& lt; Filter & gt; & Lt; Filter-name & gt; JTidyFilter & lt; / Filter-name & gt; & Lt; Filter range & gt; Org.w3c.tidy.servlet.filter.JTidyFilter & lt; / Filter range & gt; & Lt; / Filter & gt; & Lt; Filter-mapping & gt; & Lt; Filter-name & gt; JTidyFilter & lt; / Filter-name & gt; & Lt; Servlet-name & gt; DispatcherServlet & lt; / Servlet-name & gt; & Lt; / Filter-mapping & gt; & Lt; Filter-mapping & gt; & Lt; Filter-name & gt; JTidyFilter & lt; / Filter-name & gt; & Lt; URL pattern & gt; * Jsp. & Lt; / Url pattern & gt; & Lt; / Filter-mapping & gt;
Comments
Post a Comment