1

I don't know if this is related to NetBeans:

For convenience and readability I often write such code:

<p:column headerText="#{msg['name']}">
     #{recruiter.name}
</p:column>

Unfortunately, I end up with a whitespace appended to the end of the value of #{recruiter.name}:

enter image description here

However if I write

<p:column headerText="#{msg['name']}">
     #{recruiter.name}</p:column>

or

<p:column headerText="#{msg['name']}">
     <span>#{recruiter.name}</span>
</p:column>

or

<p:column headerText="#{msg['name']}">
     <h:outputText value="#{recruiter.name}" />
</p:column>

Value is displayed as expected:

enter image description here

I believe NetBeans converts my line break into a white space when not using on of the three syntaxes above but I would like to keep the best readability/simplicity.

Any tips?

Mathieu Castets
  • 5,861
  • 3
  • 28
  • 37
  • 1
    It's HTML specific: http://google.com/search?q=html+white+space+between+inline+elements JSF as being a HTML code generator can do little against it. Your best bet is writing JSF code in such way that it generates exactly the desired HTML output. Netbeans is just an editor. Like Notepad but then with many more features. It has totally no influence on how JSF behaves runtime. – BalusC Nov 17 '15 at 10:20
  • If this is HTML specific, I don't get why both `#{recruiter.name}` and `` syntaxes do not produce the same result? – Mathieu Castets Nov 17 '15 at 10:30
  • Because they do not produce exactly the same HTML output. Rightclick, *View Source* in browser, look at whitespace, etc. – BalusC Nov 17 '15 at 10:32

0 Answers0