⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c_set.jsp

📁 jsp开发详解第15章全部代码
💻 JSP
字号:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ page contentType="text/html; charset=gb2312" language="java" %>
<jsp:useBean id="user" class="com.jspdev.ch3.TestBean"/>
<html>
<head>
  <title>JSTL:的使用c:set</title>
</head>
<body bgcolor="#FFFFFF">
<hr>
设置userName的属性为hellking,然后输出这个属性值:
<c:set value="hellking" var="userName"/>
<c:out value="${userName}"/>
<hr>设置password的属性,属性值在body中,然后输出这个属性值:
<c:set var="password">
xcsdkjf234dfsgs234234234
</c:set>
<c:out value="${password}"/>
<hr>设置javaBean的属性,然后输出这些属性值:
<c:set value="hk2" target="${user}" property="userName"/>
<c:set target="${user}" property="password">
sdf234sdfd
</c:set>
userName=<c:out value="${user.userName}"/>,
password=<c:out value="${user.password}"/>.
<hr>设置不同的属性,并且指定它们的范围:
<c:set value="10000" var="maxUser" scope="application"/>
<c:set value="20" var="maxIdelTime" scope="session"/>
<c:set value="next.jsp" var="nextPage" scope="page"/>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -