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 set variable values and object properties.

The tag is thejsp:setPropertytwin brother of the action tag.

This tag is useful because it evaluates an expression and then uses the result to set the value of a JavaBean object or a java.util.Map object.

Syntax format





property

The tag has the following attributes:

property Description Whether it is required Default value
value The value to store No The content of the body
target The object whose property is to be modified No None
property The property to modify No None
var The variable that stores the information No None
scope The scope of the var attribute No Page

If the target attribute is specified, then the property attribute must also be specified.


Example Demonstration



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

    pageEncoding="UTF-8"%>

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





c:set 标签实例













The running result is as follows:



4000


JSP Standard Label LibraryJSP Standard Tag Library