<% User person1 = new User(); person1.setName("James"); person1.setPassword("23"); pageContext.setAttribute("player1", "Curry"); session.setAttribute("james", person1); %> <c:out value="昨日重现" /><!-- 直接输出常量 --> <br> <c:out value="${player1}" /><!-- 输出变量,该变量必须属于page,request,session,application的作用域 --> <br> <c:set value="durant" var="player2" /> <c:out value="${player2}" /> <br> <c:out value="${james.password}" /> <br> <c:set value="${2000*2}" var="mySalary" scope="request" /> <c:if test="${mySalary>2000 }"> <p> My Salary is <c:out value="${mySalary }" /> </p> </c:if> <ul> <c:forEach var="i" begin="1" end="10"> <li>li <c:out value="${i }" /> </li> </c:forEach> </ul> <ol> <c:forTokens items="Benz,BMW,Audio" delims="," var="car"> <li><c:out value="${car }" /> </li> </c:forTokens> </ol>