• Post Reply Bookmark Topic Watch Topic
  • New Topic

h:messages issue in jsp. extra spce not dispalying

 
rajeshkumargaru kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

i am facing the issue while displaying error msg in IE8 browser. the extra space is not displaying in browser

in properties file
-----------
message-key = data is required. please select one

here i have extra space in between (" required. please")

in jsp
-------------------
<h:messages showDetail="true" layout="table" showSummary="false"
style="font-weight: bold; color: red;" />
<m:div style="width:98%;align:center">

Plese help me. i want to display that extra space also
 
Devaka Cooray
Marshal
Posts: 5174
490
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

Extra spaces are not typically displayed in rendered HTML documents - not even here in your post.
Consider adding sequences of &nbsp; to add more spaces.
 
rajeshkumargaru kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

i tried   in properties file but in browser it was displayed   also in rendered jsp

Please help me how can i fix this extra space issue
 
rajeshkumargaru kumar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i tried with   in properties file.
but in rendered html displayed like "data is required.  please select one"

 
Tim Holloway
Bartender
Posts: 18417
60
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not a JSF problem.

HTML will compact out multiple spaces from text when it displays. You should not attempt to use the "space" character to pad text out because of this.

There are 2 principal ways to control spacing.

The traditional HTML way is to brute-force spacing via the "&nbsp;" entity. "nbsp" means "non-breaking space" and its proper use is as a simple space character in text sequences that you don't want to wrap onto another line, since the line-wrapping mechanism of HTML uses spaces as wrap points. In addition to being crude, this technique does not work well with JSF, since the nbsp entity is not part of the JSF xhtml View Template schema and can at best only be forced into actual JSF-generated output by using escape mechanisms.

The other (preferred) way to control spacing is via CSS. However, I don't known offhand of a CSS use case that does precisely what you are expecting.

The "double-space after full stop" convention was actually adopted to make text more readable on mono-spaced typewritten text. Text that has been set in proportional type is not expected expected to employ such techniques. Just aside from the relative lack of need on readability grounds, the original lead type sets contained elements called "slugs" that provided different white-space intervals, such as "m" width and "w" width.

In short, the reason you're having so much trouble is that you are attempting to employ old-fashioned typewriter conventions on a media where they don't apply. And one which doesn't guarantee exact layout anyway.

Worry more about proper capitalization.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!