5 ms·
If you mean the crazy amount of whitespace, it may be caused by a templating system. For instance, in JSP JSTL: <c:choose> <c:when test="${!empty article}"
by camtarn 16y ago
If you mean the crazy amount of whitespace, it may be caused by a templating system. For instance, in JSP JSTL:
<c:choose>
<c:when test="${!empty article}">
<c:out value="${article}"/>
</c:when>
<c:when test="${!empty comments}">
<c:out value="${article}"/>
</c:when>
</c:choose>
Each of the choose/when tags has a newline after it, so even though the tag is not output into the resulting HTML source, it causes a literal newline to be emitted. This doesn't normally matter, since HTML collapses multiple runs of whitespace into a single space.
However, for places where you can't have any whitespace (like the middle of a word) you can work around that by concatenating all the tags into one long line, or by strange arrangements of opening/closing angle brackets:
<c:choose
><c:when test="..."
><c:out ... /
></c:when
></c:choose>
Some webservers like Tomcat also provide the ability to strip all excess outgoing whitespace, which preserves the readability of the source files.