Reputation: 477
We are using s:property tag to display string value on struts 2.
<s:property value="stringValue"/>
If "stringValue" has multiple spaces then it is showing only 1 space instead of exact text.
Ex: String stringValue ="Hello World, Welcome";
Output: Hello World, Welcome.
Here string text has two space in between but on application it is displaying only 1 space.
I have tried to use escapeHtml as false but same issue.
What is wrong with this tag?
Best Regards, RKG
Upvotes: 0
Views: 745
Reputation: 160191
Nothing is wrong with the tag.
HTML treats multiple whitespaces as a single whitespace; that's just the way HTML is.
If you want to explicitly have multiple spaces you'll need to convert them to
entities. There are a zillion ways to do that.
Upvotes: 4