Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

c:out and ${} in JSP file

Tags:

jsp

jstl

el

is there difference in using

<c:out value="${a}"/>

and just

${a}

in a JSP file?

like image 722
Paolo Avatar asked Oct 25 '25 23:10

Paolo


1 Answers

Yes, JSTL's out tag will transform certain characters to their XML escape sequences as stated in the documentation:

Attribute escapeXml: Determines whether characters <,>,&,'," in the resulting string should be converted to their corresponding character entity codes. Default value is true.

Note that if the goal is to produce cleaner markup then look at the escapeXml function in the http://java.sun.com/jsp/jstl/functions namespace as an alternative.

like image 200
McDowell Avatar answered Oct 29 '25 13:10

McDowell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!