Reputation: 2472
is there difference in using
<c:out value="${a}"/>
and just
${a}
in a JSP file?
Upvotes: 4
Views: 10158
Reputation: 432
Try Changing your taglibs:
<%@ taglib prefix="c" uri="htttp://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="htttp://java.sun.com/jsp/jstl/fmt" %>
to
<%@ taglib prefix="c" uri="htttp://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="htttp://java.sun.com/jstl/fmt" %>
Upvotes: 0
Reputation: 108899
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 istrue
.
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.
Upvotes: 8
Reputation: 966
For just printing the out put both or same. But when we don't have value for variable 'a' then it will print 'NULL'.
To overcome this we can use default in c:out tag.
Ex:<c: out value='${a}' default='guest' />
Upvotes: 0