【转】JSP去空白行
<jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <trim-directive-whitespaces>true</trim-directive-whitespaces> </jsp-property-group></jsp-config>
?
?
这种方式是在jsp 编译成class时将空白行去掉,因此是一次完成,效率很高。
?
?
2、在每个JSP的头上加上一段代码?? <%@?page?trimDirectiveWhitespaces="true"?%>
?
以上两种方法取其一即可,建议使用第一种。