1

I am attempting to learn a bit about Java Faces using the Oracle/Sun JavaEE tutorial as I learn about Java EE in general. I ran into something that's been bothering me that I can't seem to fix.

In an xhtml page the following block of code:

<p>I've made your <h:link outcome="personal" value="personal greeting page!" 
                    includeViewParams="true">
                  <f:param name="Result" value="#{hello.name}"/>
             </h:link>
</p>

Get's displayed like:

I've made yourpersonal greeting page!

For some reason it's not recognizing the space between the word your, and the start of the link. When I look at the HTML source, it looks like its been trimmed out entirely. I've tried both manually adding an &nbsp; and I've tried turning whitespace compression off in the WEB-INF/faces-config.xml

Does anyone have an explanation for this behaviour and a way to fix it?

David M
  • 31
  • 4

1 Answers1

0

Found the answer here: how to insert space in jsf page

Inserting the following tag will force a space to be rendered in a JSF page.

<h:outputText value="&#160;" />

Ex:

<p>I've made your<h:outputText value="&#160;" />
   <h:link outcome="personal" value="personal greeting page!" includeViewParams="true">
       <f:param name="Result" value="#{hello.name}"/>
   </h:link>
</p>

Now correctly renders:

I've made your personal greeting page!

Community
  • 1
  • 1
David M
  • 31
  • 4