<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
long num=Math.round(Math.random()*10);
if(num%2==0){
System.out.println("随机产生偶数数字:"+num);
%>
<jsp:forward page="evenNumber.jsp">
<jsp:param value="<%=num %>" name="num"/>
</jsp:forward>
<%
}
else{
System.out.println("随机产生奇数数字:"+num);
%>
<jsp:forward page="oddNumber.jsp">
<jsp:param value="<%=num %>" name="num"/>
</jsp:forward>
<%
}
%>
</body>
</html>
02-27
772
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-20
2186
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
11-13
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-26
719
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)