Tomcat 5.X and Tomcat 6.X remove JSP source blank line

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.