标签:el表达式
<c:out> 标签用于输出一段文本内容到pageContext对象当前保存的“out”对象中。<c:remove>标签用于删除各种Web域中的属性
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv=" pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> </head> <body> <h1>cremove标签</h1> <% pageContext.setAttribute("name", "葵花点穴手"); request.setAttribute("name", "猴子偷桃"); session.setAttribute("name", "黑风双杀"); application.setAttribute("name", "九阴白骨抓"); %> <c:remove var="name" scope="page"/> ${name } <h1>cset标签</h1> <!-- 设置name到page域宗 --> <c:set var="name" value="李卫康"></c:set> <c:set var="name" value="韩玮"></c:set> ${name} <% Map map=new HashMap(); pageContext.setAttribute("map", map); %> <c:set target="${map}" property="cellphone" value="10010"></c:set> ${map.cellphone} <c:set var="string" value="韩玮" scope="request"></c:set> ${string } <h1>cout标签</h1> <h3>输出默认值</h3> <% String addr="北京"; %> <c:out value="${addr }" default="南和"></c:out> <h3>输出变量</h3> <% String name="韩玮"; pageContext.setAttribute("name", name); %> <c:out value="${name}"></c:out> <h3>输出常量</h3> <% String str="李卫康"; %> <c:out value="${'liweiakng' }"></c:out> </body> </html>运行结果:
黑马day06 EL表达式之cout&cset&cremove标签
标签:el表达式
原文地址:http://blog.csdn.net/u014010769/article/details/46592951