老师帮忙看下有没有需要改进的地方,谢谢
来源:2-8 自由编程
ByteDancer07
2020-02-21 08:20:24
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>test JTIL</title> </head> <body> <% int x = (int)(Math.random()*21); request.setAttribute("x", x); %> <c:if test = "${x<=10 }"> <c:if test = "${x>=0}"> <h1>${x}</h1> <h2 style="color:blue">1-10之间的整数</h2> </c:if> </c:if> <c:if test = "${x<=20 }"> <c:if test="${x>10}"> <h1>${requestScope.x}</h1> <h2 style="color:red">10-20之间的整数</h2> </c:if> </c:if> </body> </html>
1回答
同学完成的不错,加油,祝学习愉快~
相似问题