• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Write bean property containing HTML

 
Samy Ganou
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you are using jsp for displaying data.
use following format
 
Samy Ganou
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use escapeXml property of <cut tag set to "false"

example

 
Samy Ganou
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65124
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic