GeeCON Prague 2014*
The moose likes Struts and the fly likes Print to formated text Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Print to formated text" Watch "Print to formated text" New topic
Author

Print to formated text

Polo Palos
Greenhorn

Joined: Mar 17, 2006
Posts: 12
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Mar 17, 2006
Posts: 12
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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Mar 17, 2006
Posts: 12
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
 
GeeCON Prague 2014
 
subject: Print to formated text