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
| 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 Tag Library