Results 1 to 3 of 3
- 08-07-2009, 10:23 AM #1
Member
- Join Date
- Aug 2009
- Posts
- 2
- Rep Power
- 0
How to display a String that contains more than one white spaces
Hi all,
I am facing a problem about displaying a String including more one white space at the middle in the Label form. Here is my line code in a JSP page:
...
<c:out value="${profile.profileName}" />
...
All of us knew that HTML rendering will automatically trim the white space. Therefore if in the database the profile name has 3 white spaces at the middle, then it will be trimmed 2 white spaces.
However, if I encodes that string into "1 2" and set escapeXml to false, then the displayed string will be correct.
It seems that this attribute can help me out but unfortunately if user enters a value " " for the Profile name field, then since I set escapeXml to false, a white space will be displayed instead of the value user entered.
Is there any way to solve my issue?
Thanks ahead for your help!
- 09-27-2009, 02:29 AM #2
Can you place the c out tag inside a <pre> or a <div> tag with the CSS
white-space : pre;
(and then leave excapeXML to true)
- 09-27-2009, 09:16 AM #3
Member
- Join Date
- Aug 2009
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
Need to display the jsp variable(String) into html?
By Arivudai Nambi in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 02-25-2009, 05:44 PM -
display histogram that count white pixels
By TamTam in forum Java 2DReplies: 6Last Post: 02-14-2009, 09:26 PM -
BufferStrategy and white rows of pixels
By TobyLobster in forum Java 2DReplies: 2Last Post: 12-29-2008, 01:49 PM -
Cannot display a random string from .dat file
By explosion242 in forum New To JavaReplies: 2Last Post: 09-18-2008, 01:48 PM -
White Space Issue
By sibythoma1984 in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 04-22-2008, 12:05 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks