EL: escaping HTML

T

Timo Nentwig

Hi!

I need to escape HTML - can this be done with EL alone? For a matter of
quotations marks I cannot use JSTL in a plain JSP:

<a href="javascript:f('<c:eek:ut value="problem"/>')">

Timo
 
M

Murray

Timo Nentwig said:
Hi!

I need to escape HTML - can this be done with EL alone? For a matter of
quotations marks I cannot use JSTL in a plain JSP:

<a href="javascript:f('<c:eek:ut value="problem"/>')">

Timo

Why can't you use JSTL? I don't understand...
 
T

Tobias Schierge

Hi,

in JSP 2.0 you can use:

<a href="javascript:f('${problem}')">

for JSP 1.2 you can stick to taglibs if you want to have the file
well-formed. Are you using struts? Then you can do:

<html:link href="javascript:f('${problem}');">link label</html:link>

Regards,

Tobias
 
T

Timo Nentwig

Timo said:
Hi!

I need to escape HTML - can this be done with EL alone? For a matter of
quotations marks I cannot use JSTL in a plain JSP:

<a href="javascript:f('<c:eek:ut value="problem"/>')">

Timo

${fn:escapeXml(problem)}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,059
Members
48,769
Latest member
Clifft

Latest Threads

Top