How do I insert non breaking space character   in a JSF page?

前端 未结 11 1982
南旧
南旧 2020-12-12 20:44

How do I insert a non breaking space character in JSF page like I can in HTML using  ? Is there such a tag in JSF?

11条回答
  •  北荒
    北荒 (楼主)
    2020-12-12 21:41

    I found that the parser would complain if I used the   entity in my page. After a little research, I learned that if I added a DOCTYPE declaration to the beginning of the page, the entity was allowed. I use this DOCTYPE declaration:

    
    

    A side effect of this is that the resulting code (as seen by using the "view source" feature of a web browser) doesn't actually contain the   entity. It instead includes the actual characters that represent a nonbreaking space. Although it works, it's not really what I want. I'm still looking for a way to make the parser not replace the entity with the character.

    More information here: http://java.net/jira/browse/JAVASERVERFACES-1576

提交回复
热议问题