Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

c:out trim problem

 
Prasad murali
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a message to display using <cut>

<cut value="${message}"/>

where the message is a request attribute containing the string
"The Lake". This string contains 3 whitespace between the words 'The' and 'Lake'. I need to display the message in the same way it is present but <cut tag trims the whitespaces between the words and the string is displayed with only 1 whitespace between them.

Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that cut trim anything. I think that the HTML gets rid of the extra spaces.
You could try to use JSTL's fn:replace function, to replace spaces with the HTML code "nbsp".
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing to keep in mind is that HTML renderers (per their spec) will trim whitespace. Before looking at the cut tag, or any other server side technology, always make sure to view the HTML source to see if the whitespace is actually being trimmed before it reaches your browser.
 
Prasad murali
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you guys for the response !!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic