Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

tag

tag

JSP Standard Label LibraryJSP Standard Tag Library

The tag is used to display the result of an expression, similar to the<%= %> action; the difference between them is that thetag can access properties directly through the "." operator.

For example, to access customer.address.street, you only need to write it like this:。

The tag automatically ignores XML markup characters, so they are not treated as tags.


Syntax format





property

The tag has the following attributes:

property Description Whether it is required Default value
value The content to output Is None
default The default value to output No The content in the body
escapeXml Whether to ignore XML special characters No true

Program Example



<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>







c:out 标签实例





    

实例



使用的表达式结果为null,则输出该默认值

The running result is as follows:



 实例



<要显示的数据对象(未使用转义字符)>

<要显示的数据对象(使用转义字符)>

使用的表达式结果为null,则输出该默认值


JSP Standard Label LibraryJSP Standard Tag Library