This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Getting MEAN with Mongo, Express, Angular, and Node and have Simon Holmes on-line!
See this thread for details.
The moose likes JSP and the fly likes Escape HTML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "Escape HTML" Watch "Escape HTML" New topic
Author

Escape HTML

saumil baxi
Ranch Hand

Joined: Apr 18, 2008
Posts: 58
Hi,
Following is the jsp code




The problem that I am getting is. It does not convert & into Escape HTML form..

Is there any taglib or other method available to convert special character into HTML escape character.

Thanks,
Saumil
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62601
    
  68

<cut>


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62601
    
  68

And for doing it in a place where tags cannot be used:

${fn:escapeXml(value)}

Read the JSTL Spec for more information.
saumil baxi
Ranch Hand

Joined: Apr 18, 2008
Posts: 58
i tried <cut > it didnt work.. []
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62601
    
  68

"it didn't work" is the most useless phrase you could post here.

What did happen? What did you expect to happen? What do you want to happen?
 
Don't get me started about those stupid light bulbs.
 
subject: Escape HTML