冉冉說
2019-07-22 19:43:11
從jsp輸出的條形空白區(qū)如何從jsp頁面的輸出中去掉額外的空白?我可以在web.xml上打開開關(guān)嗎?是否有Tomcat特定設(shè)置?
3 回答

翻過高山走不出你
TA貢獻(xiàn)1875條經(jīng)驗(yàn) 獲得超3個贊
<%@ page trimDirectiveWhitespaces="true" %>
<jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <trim-directive-whitespaces>true</trim-directive-whitespaces> </jsp-property-group></jsp-config>

飲歌長嘯
TA貢獻(xiàn)1951條經(jīng)驗(yàn) 獲得超3個贊
trimDirectiveWhitespaces
JspServlet
trimSpaces
true
JspServlet
/conf/web.xml
:
<init-param> <param-name>trimSpaces</param-name> <param-value>true</param-value></init-param>
添加回答
舉報(bào)
0/150
提交
取消