Reputation: 1
I am getting issue somthing h:outputText and h:inputText both are displaying values but they are collapse the multiple whitespaces into single white space
for that i tried with style="white-space:pre" but it also not working so i am adding in between strings
String str="hi & nbsp jsf" and
while displaying it shows in input text box with value "hi & nbsp ;jsf" not "hi jsf" So, what should i have to do so that that it will display without "& nbsp;"
actually i have put that space between & nbsp; because here it will replaceing with white space
I don't want with escape="false" for displaying because at some place i need h:inputText. In h:inputText there is no option for escape attribute
any other permanent solution for white Space Issue
Upvotes: 0
Views: 807
Reputation: 7871
You need to use the code of nbsp, because nbsp is not an entity automatically declared like in html pages.
The code is 160, so you can use  
.
Alternatively, you can declare an entity at the top of your page like this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
[<!ENTITY nbsp " ">]>
and you are free to use
Upvotes: 0