1.out set
<% request.setAttribute("abc", "<font style='color:red'>你好</font>"); %>
<c:out value="${abc}" escapeXml="true">默认值</c:out><br>
<c:set var="name" value="李四"/>
${name}<br>
给Javabean设置值
<jsp:useBean id="user" class="com.lps.pojo.Users"></jsp:useBean>
<c:set target="${user}" property="userName" value="王五"></c:set>
${user.userName }<br>
2.if
将判断结果以 对象 result 存入 request区间
scope:区间范围
<c:if test="${1+1==2}" var="result" scope="request">
正确了则显示
</c:if>
${result}<br>
3.c:choose
<c:choose>
<c:when test="${a==1}">1的值</c:when>
<c:when test="${a==2}">2的值</c:when>
<c:when test="${a==3}">3的值</c:when>
<c:otherwise>都不是</c:otherwise>
</c:choose><br>
4.c:forEach
step:每次跳过几个
<c:forEach begin="1" end="10" step="1">
a
</c:forEach><br>
status.index:索引{status.count}:已经显示的数量
status.first:是不是第一个{status.last}:是不是最后一个
<%
List<String> list=new ArrayList<String>();
list.add("abc");
list.add("def");
list.add("hij");
request.setAttribute("list", list);
%>
<c:forEach var="str" items="${list}" varStatus="status">
${str }:${status.index},${status.count},${status.first},${status.last}<br>
</c:forEach><br>
6.c:forTokens
以“,”分割字符串
<c:forTokens var="str" items="a,b,c" delims=",">
${str }<br>
</c:forTokens>