Name
<c:out>
Synopsis
The <c:out>
action
adds the evaluation result of an
expression
to the current response buffer (JspWriter), or a
default value if the main expression evaluates to
null. The evaluation result is always converted to
a String; it follows the coercing rules described
in Appendix C.
Syntax 1: Without a body
<c:out value="expression" [escapeXml="[true|false]"] [default="defaultExpression"] />
Syntax 2: With a body
<c:out value="expression" [escapeXml="[true|false]"]>defaultExpression</c:out>
Attributes
|
Attributename |
Java type |
Dynamic valueaccepted |
Description |
|---|---|---|---|
value |
Object |
Yes |
The expression to evaluate. |
escapeXml |
boolean |
Yes |
If |
default |
Object |
Yes |
The default expression to use if the expression defined by value
evaluates to |
Example
<c:out value="${param.phone}" default="No phone" />
<c:out value="${user.imageURL}">
<c:url value="/defaultUserImage.jpg" />
</c:out>Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access