锚标签之间的很多空的空间

时间:2012-05-31 08:43:16

标签: html jsp anchor

嗨我有一个讨厌的问题。看看下面的代码,在代码中我有2个链接,根据自定义标签检查的条件出现。问题是,当我看到此页面的HTML源代码时,第二个锚点在第一个锚点后出现700行(空行)。任何人都帮我解决这个问题。谢谢你提前......

<a href="${contextPath}/rts/reports/listOfReports.do"> rts</a>
<s:userHasAccess functionId="<%=ReportsConstants.CFS_LOAD_PLANNING_FNCT_ID%>">             
<jsp:attribute name="yes">
<a href="${contextPath}/lprt/reports/listOfReports.do">lprt</a>

自定义标记执行权限检查并返回true或false。

更新: HTML来源:

<a href="/ptp/rts/reports/listOfReports.do"> rts</a> //700 blank lines
<a href="/ptp/lprt/reports/listOfReports.do">lprt</a>

1 个答案:

答案 0 :(得分:0)

这在web.xml中添加trim whitespace指令后起作用。

<jsp-property-group>     
<url-pattern>*.do</url-pattern>     
<trim-directive-whitespaces>true</trim-directive-whitespaces>   
</jsp-property-group>