<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><html><head><meta charset="utf-8"><title>Simplicity</title></head><body>? <img src="image/xplogo.gif">? <ul>? ? <%? ? ? ? int loop = 1; // 默認(rèn)值? ? ? ? String loopStr = request.getParameter("loop");? ? ? ? // 判斷l(xiāng)oopStr是否為空? ? ? ? if (loopStr != null && loopStr.length() > 0) {? ? ? ? ? ? loop = Integer.valueOf(loopStr);? ? ? ? }? ? %> ?? ? <%-- Simple comment at server side --%>? ? <!-- Simple comment at client side -->? ??? ??? ? <%? ? ? ? for (int x = 0; x < loop; x++) {? ? %>? ?? ? <li><h2>Do the simplest thing that could possibly work.</h2></li>? ? <li><h2>You Aren't Going to Need It. [YAGNI]</h2></li>? ? <%? ? ? ? }? ? %>? </ul>? <%--!String userName = "Kent Beck"; --%>? <%? ? ? String name = "Kent Beck";? %>? <%=name%></body></html>
?怎么用JSTL替換其中的JSP腳本元素?
erutdioup8556
2016-03-20 12:29:16