<c:out>标记显示表达式,类似的方式<%= %>工作和<c:out>标记可让您使用更简单的一个差的结果“.”符号来访问属性。例如,要访问customer.address.street 只使用标签<c:out value="customer.address.street"/>。
<c:out>标记可以自动转义XML标记,因此不计算为实际的标签。
<c:out>标记具有以下属性:
属性 | 描述 | Required | Default |
---|---|---|---|
value | Information to output | Yes | None |
default | Fallback information to output | No | body |
escapeXml | True if the tag should escape special XML characters | No | true |
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <html> <head> <title><c:out> Tag Example</title> </head> <body> <c:out value="${'<tag> , &'}"/> </body> </html>这将产生以下结果:
<tag> , &