ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Six Cool New JSP and Servlet Features
Subject:   <c:out/> and escaping
Date:   2004-02-12 10:14:45
From:   bperry
Response to: and escaping

I will add to your helpful comment:
Using Tomcat 5.x, include the following code in a JSP:
<c:set var="myValue" value="a tag </tag>" />
<c:out value="${myValue}" /></ br>
${myValue}


This will produce the following browser output in the client:


a tag </tag></ br>
a tag </tag>


Meaning that the client browser will output "</tag>" when the c:out element is used (because the "</ >" characters are escaped); however, including the EL statement in template text will cause the tag to be added to the underlying template code.


1 to 1 of 1
1 to 1 of 1