I am facing a challenge with displaying a full name (firstName lastName) on a webpage.
Within my JSP file, the code snippet looks like this:
<span>
<c:if test="${someCondition1}">
<c:out value="${firstName}">
</c:if>
<c:if test="${someCondition2}">
<c:out value="${lastName}">
</c:if>
</span>
There seems to be an issue with the code indentation spaces inside the span element. Interestingly, the spaces are not collapsing in Firefox, but they do in IE.
Despite my attempts to use CSS white-space properties such as normal, wrap, -moz-pre-wrap, the problem persists.
It's worth noting that adding the white-space property might not be a viable solution, as the first Name or last Name could contain multiple spaces that need to be preserved, for example:
"my First Name"
Therefore, applying CSS white-space to collapse multiple spaces within the span element would be incorrect.