When you look at the code generated by the JSP using view source, you will find that there are a lot of empty rows, which are generated by the <%...%> carriage return line, which means that each row consists of <%...%> Including the JSP code to the client has become a blank line, although not affect reading, but still hope to delete them
The method is as follows: (online collection and collation)
1. Support JSP 2.1+, include the following code in each page to go to the blank line:
<%@ page trimdirectivewhitespaces= "true"%><%@ page trimdirectivewhitespaces= "true"%>
Test success under Tomcat 6.0.14
2. Support Servlet 2.5+, that is, the XSD version of Web. XML is 2.5, participate in the following code in Web. xml
Tomcat 5.X and Tomcat 6.X remove JSP source space-No letter-No letter blog *.jsp
Tomcat 5.X and Tomcat 6.X remove JSP source space-no letter-don't believe the blog true
Tomcat 5.X and Tomcat 6.X remove JSP source space-----------the blog of unbelief--6.0.14 under Tomcat
3. Tomcat 5.5.x+, find the servlet named "JSP" in the Tomcat appliance directory/conf/web.xml, adding the following code:
Wstudio-debugger-tomcat6
Org.apache.jasper.servlet.JspServlet
Suppresssmap
True
Trimspaces
True
3
Wstudio-debugger-tomcat6
*.jsp