0

I'm using spring mvc and I have a problem with <spring:message /> tag.
In properties file I have line:
label.inquiry=Inquiry
but when I use it in <spring:message code="label.inquiry" /> the output is: Inquiry
One new line character and few spaces. Why and how to resolve this problem?

UPDATE:
I paste an some jsp code

<div style="clear:both;margin:5px;">
  <a class="btn mini inquiryFile" href="<c:url value="/download/brokerinquiry.html?ciid=${element.brokerInquiryElement.customerInquiryElement.customerInquiry.id}&sid=${element.brokerInquiryElement.supplier.id}"/>">
    <spring:message htmlEscape="false" code="label.inquiry"/> <i class="icon-download"></i>
  </a>
</div>
bemol
  • 381
  • 3
  • 18

1 Answers1

1

The new line character and the spaces are in your jsp. You could do

<div style="clear:both;margin:5px;">
  <a class="btn mini inquiryFile" href="<c:url value="/download/brokerinquiry.html?ciid=${element.brokerInquiryElement.customerInquiryElement.customerInquiry.id}&sid=${element.brokerInquiryElement.supplier.id}"/>"><spring:message htmlEscape="false" code="label.inquiry"/> <i class="icon-download"></i>
  </a>
</div>

You can also take a look at Strip whitespace from jsp output. Personally, I use Freemarker, and its directive <#ftl strip_whitespace=true>, so I hope the former link is the jsp variant of that.

Community
  • 1
  • 1
qkrijger
  • 26,686
  • 6
  • 36
  • 37