Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic