saurabh ranu
saurabh ranu

Reputation: 1371

How to render html text inside a html body

I have some text like below saved in a text file

<b>This is my life</b>

I want to show this text as looking below

This is my life

But currently in my html page i can see just this text

<b>This is my life</b>

How i can achieve step 1 ..?

I am getting the above text in a html page as follows

  <p class="demo"><c:out value="${demo.text}"/></p>

it's basically a struts application and jsp pages .

Upvotes: 0

Views: 546

Answers (1)

antyrat
antyrat

Reputation: 27765

Your text in saved text file is html special chars encoded. You need to decode it before inserting. For example replace &lt; to < and &gt; to > character in all text saved in text file and then insert result into html page.

Upvotes: 1

Related Questions