hello_world
hello_world

Reputation: 215

Is it possible to omit escaping some html in <c:out value="${str}">?

I want make secure display (escaping html characters with c:out) but allow some links (<img> <a href> and youtube embedded). How can I do this? Is it possible achieve this with c:out?

Upvotes: 2

Views: 896

Answers (1)

Jigar Joshi
Jigar Joshi

Reputation: 240870

Use escapeXml

<c:out value="${test}" escapeXml="true" />

To prevent XSS attacks also look at JSoup Cleaner

Upvotes: 3

Related Questions