Link to home
Start Free TrialLog in
Avatar of Damn
Damn

asked on

Escaping Html with EL expressions similar to <c:out escapeXml=”true”

Hi,

I have following code in my JSP page:
<td class="td_muc" align="left">${document.description}</td>      

When I put some Html tags inside document.description, these tags will be processed by browser. I would like to avoid this, and one way is to replace this with jstl tag:
<td class="td_muc" align="left"><c:out value=”${document.description}”></td>      

This way entities will be automatically encoded, for example < will be automatically encoded to &lt;.

I have a huge existing jsp code-base and I would like to encode output without significantly modifying code and while keeping
<td class="td_muc" align="left">${document.description}</td>.      
Is there any way to perform this encoding without using jstl tags, by means of some directive or similar?

Thank you,

Damn
ASKER CERTIFIED SOLUTION
Avatar of evnafets
evnafets

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial