• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to return a string in JSP with HTML tags

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everyone,

First of all I don't know if this topic is a JSP issue or a Struts issue, so if this topic is at the wrong place, please move it to the right one.

I'm trying to make a forum in java Struts 2. But when I create a post/topic with javascript TextEditors they put HTML tags in the string and when I return it from the database to the JSP with <s:property value='text'/> the tags don't disappear.
So I read that I should convert the HTML string to 'text'. To do it I used StringEscapeUtils.





Ex.:

[INPUT]:



[OUTPUT with ${text}]:



[OUTPUT with <s:property value='text'/>]:


What should I do to the text turn into HTML?

Obs.: Sorry for my bad english.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch!

In the future please post text, not screen shots. Screen shots are not searchable. (For the code, I see you used the code tags; good show!)

I have moved this to the Struts forum for you.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps this topic posted yesterday will help you out.
 
Leandro Alves
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Joe Ess wrote:Perhaps this topic posted yesterday will help you out.



Joe,

Thanks dude!
It solved my problem!
Thanks a lot! =D
 
reply
    Bookmark Topic Watch Topic
  • New Topic