wood burning stoves 2.0*
The moose likes JSP and the fly likes Write bean property containing HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Write bean property containing HTML" Watch "Write bean property containing HTML" New topic
Author

Write bean property containing HTML

Samy Ganou
Greenhorn

Joined: Oct 05, 2009
Posts: 28
Hello ,
I work with a frame like struts.
I have bean :
MyBean{
private string htmlFlow;
..}

And i want that the content of my property htmlFlow will be writed on my jsp and interpreted as HTML content.
When i use cut , it print all the text , exemaple : <table><tr>Hello..

I want to see 'Hello'and not all html.

Thank you in advance.
Gireesh Giri
Greenhorn

Joined: Apr 23, 2010
Posts: 23
if you are using jsp for displaying data.
use following format
Samy Ganou
Greenhorn

Joined: Oct 05, 2009
Posts: 28
I can not do that , beacause may data already exist on my Bean. I want ti get it from mu bean.
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
Use escapeXml property of <cut tag set to "false"

example



Bye,
Nicola
Samy Ganou
Greenhorn

Joined: Oct 05, 2009
Posts: 28
Nicola Garofalo wrote:Use escapeXml property of <cut tag set to "false"

example



It work , thank you !! I have seen this property , but i thought that it's used for xml purpose and not html ..
Nicola Garofalo
Ranch Hand

Joined: Apr 10, 2010
Posts: 308
escapeXml is an attribute of tag out

From the Documentation:
Determines whether characters <,>,&,'," in the resulting string should be converted to their corresponding character entity codes. Default value is true.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61652
    
  67

Gireesh Chetty wrote:if you are using jsp for displaying data.
use following format

NO. DO NOT. BAD BAD BAD suggestion!

DO not place any Java code in a JSP. That is a practice that has been discredited for over 8 years now.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Write bean property containing HTML