Jsp-jstl-core-out-tag
提供:Dev Guides
JSTL-コア<c:out>タグ
*<c:out>* タグは、式の結果を表示します。 これは、 *<%=%>* の動作とほぼ同じです。 ここでの違いは、 *<c:out>* タグを使用すると、より簡単な *"。"* 表記を使用してプロパティにアクセスできることです。 たとえば、customer.address.streetにアクセスするには、タグ<*:<c:out value = "customer.address.street"/> *を使用します。
*<c:out>* タグはXMLタグを自動的にエスケープできるため、実際のタグとして評価されません。
属性
<c:out>タグには次の属性があります-
Attribute | Description | 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> , &