<%@ 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; // 默认值 String loopStr = request.getParameter("loop"); // 判断loopStr是否为空 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>
添加回答
举报
0/150
提交
取消