This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Print to formated text

 
Polo Palos
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

I want to print formated text.
When I use to do <s:textarea> I don't have any problem,

but I want to print it by <s:label> or <s:property>.


If is possible to use this tag above?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Depends on what you mean by "formatted text". If you mean line breaks, then no--this is just how HTML works; excess whitespace is ignored by the browser, and needs to be converted on the server side (like, replacing CRLF with <br> tags, etc.)
 
Polo Palos
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Formatted text, what mean for me: text with CRLF.
I add on the server side
tag, like thist for testing:

but I see my text with

on the web page like this:
"Text aaaooouuu...."

My example text.

.

Where is the problem?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The property tag has an "escapeHtml" attribute that defaults to true; make sure it's false. Also, just use "
".

If *that* doesn't work, then something else is wrong.
 
Polo Palos
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I strange, but I have only: "escape", I can't use: "escapeHtml".

I use Struts 2.1.8.1 and in documentation is this tag.

I can't understand it.


Polo
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!