JSP第三次作业
<%@ page contentType="text/html"%> <%@ page pageEncoding="utf-8"%> <HTML> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body bgcolor=cyan> <br>英文课文(English Text): </br> <p style="font-family:宋体;font-size:18;color:black"> <jsp:include page="english/english.txt" /> <br>课文音频(English Audio):</br> <jsp:include page="audio.jsp" /> </p> </body> </HTML> <%@ page contentType="text/html"%> <%@ page pageEncoding="utf-8"%> <HTML> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </head> <body bgcolor=cyan> <br>英文课文(English Text): </br> <p style="font-family:宋体;font-size:18;color:black"> <jsp:include page="english/english.txt" /> <br>课文音频(English Audio):</br> <jsp:include page="audio.jsp" /> </p> </body> </HTML>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <%!double r=(int)(Math.random()*10)+1; %> <jsp:include page="circle.jsp"> <jsp:param name="r" value="4"/> </jsp:include> <br> <jsp:include page="ladder.jsp"> <jsp:param name="a" value="4"/> <jsp:param name="b" value="4"/> <jsp:param name="c" value="4"/> </jsp:include> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index1.jsp' starting page</title> </head> <body> </body> </html> <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index1.jsp' starting page</title> </head> <body> <%!double getarea(double r){ double area=3.14*r*r; return area; } %> <% String r=request.getParameter("r"); double r1=Double.parseDouble(r); double area=getarea(r1); out.print("圆形的半径是"+r+",圆形的面积:"+area); %> </body> </html> <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>My JSP 'index1.jsp' starting page</title> </head> <body> <%!double getarea(double a,double b,double c){ double area=(a+b)*c/2; return area; } %> <% String string=request.getParameter("a"); double s1=Double.parseDouble(string); string=request.getParameter("b"); double x1=Double.parseDouble(string); string=request.getParameter("c"); double g1=Double.parseDouble(string); double area=getarea(s1, x1, g1); out.print("梯形的上底是"+s1+"下底是"+x1+"高是"+g1+"面积是"+area); %> </body> </html>
<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> </head> <body> <table width="500px" height="500px" border="1" bordercolor="blue" align="center"> <tr> <td colspan="2"><%@ include file="top.jsp"%></td> </tr> <tr> <td><%@ include file="left.jsp"%></td> <td><%@ include file="right.jsp"%></td> </tr> <tr> <td colspan="2"><%@ include file="end.jsp"%></td> </tr> </table> </body> </html> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> rsone里边的内容 </head> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title> rstwo里边的内容 </head> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title>rsthree里边的内容 </head> <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Insert title here</title>rsfour里边的内容 </head>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> <title>My JSP 'ZongShu.jsp' starting page</title></head> <body> <%int number=(int)(Math.random()*10+1); if(number%2==0){ %> <jsp:forward page="Ou.jsp"> <jsp:param value="<%=number %>" name="number"/> </jsp:forward> <% } else{ %> <jsp:forward page="Ji.jsp"> <jsp:param value="<%=number %>" name="number"/> </jsp:forward> <%} %> </body> </html> <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'Ou.jsp' starting page</title> </head> <body> <p style="font-family:宋体;font-size: 20"> <%String s=request.getParameter("number"); int x=Integer.parseInt(s); out.print("这个随机数是:"+x+",这个数字是偶数"); %> </p> </body> </html> <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'Ji.jsp' starting page</title> </head> <body> <p style="font-family:宋体;font-size: 20"> <%String s=request.getParameter("number"); int x=Integer.parseInt(s); out.print("这个随机数是:"+s+",这个数字是奇数"); %> </p> </body> </html>