第五周作业
1 listenEnglish.jsp: 2 3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 4 <html> 5 <head> 6 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 7 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 8 <title>listenEnglish</title> 9 </head> 10 <body bgcolor=cyan> 11 <br>英文课文(English Text):</br> 12 <p style="font-family:宋体;font-size:18;color:black"> 13 <jsp:include page="English/english.txt"/> 14 <br>课文音频(English Audio):</br> 15 <jsp:include page="audio.jsp"/> 16 </p> 17 </body> 18 </html>
1 audio.jsp: 2 3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 4 <html> 5 <head> 6 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 7 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 8 <title>audio</title> 9 </head> 10 <body bgcolor=pink> 11 <embed src="English/english.mp3"autostart=false> 12 课文音频 13 </embed> 14 </body> 15 </html>
2.
1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 2 <html> 3 <head> 4 <title>My JSP 'main.jsp' starting page</title> 5 </head> 6 7 <body> 8 <jsp:include page="circle.jsp"> 9 <jsp:param value="10" name="r"/> 10 </jsp:include> 11 <br> 12 <jsp:include page="ladder.jsp"> 13 <jsp:param value="10" name="shang"/> 14 <jsp:param value="20" name="xia"/> 15 <jsp:param value="2" name="gao"/> 16 </jsp:include> 17 </body> 18 </html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <html> <head> <title>My JSP 'main.jsp' starting page</title> </head> <body> 圆面积 <% String r=request.getParameter("r"); double a=Double.parseDouble(r); double s=a*a*3.14; out.println(s); %> </body> </html>
1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 2 <html> 3 <head> 4 <title>My JSP 'main.jsp' starting page</title> 5 </head> 6 7 <body> 8 梯形面积 9 <% 10 String shang=request.getParameter("shang"); 11 String xia=request.getParameter("xia"); 12 String gao=request.getParameter("gao"); 13 double a=Double.parseDouble(xia); 14 double b=Double.parseDouble(xia); 15 int c=Integer.parseInt(gao); 16 double s=(a+b)*c/2; 17 out.println(s); 18 19 %> 20 </body> 21 </html>
3.
1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 2 3 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 4 <html> 5 <head> 6 <title>My JSP 'BiaoGe.jsp' starting page</title> 7 </head> 8 9 <body> 10 <table bgcolor="#6495ED" align="center" border="1" height="20" width="600"> 11 <tr align="center"> 12 <td colspan="2"><jsp:include page="Top.jsp"/></td> 13 </tr> 14 <tr align="center" > 15 <td><jsp:include page="Left.jsp"/></td> 16 <td><jsp:include page="Right.jsp"/></td> 17 </tr> 18 <tr align="center"> 19 <td colspan="2"><jsp:include page="End.jsp"/></td> 20 </tr> 21 </table> 22 </body> 23 </html>
1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 2 <%="这里是Top.jsp显示的页面" %>
1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 2 <%="这里是Left.jsp显示的页面" %>
1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 2 <%="这里是Right.jsp显示的页面" %>
1 <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> 2 <%="这里是End.jsp显示的页面" %>
4.
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 <% 3 String path = request.getContextPath(); 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 %> 6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 7 <html> 8 <head> 9 <base href="<%=basePath%>"> 10 <title>My JSP 'index1.jsp' starting page</title> 11 </head> 12 <body> 13 <% 14 String r=request.getParameter("i"); 15 int x=Integer.parseInt(r); 16 out.print("随机数"+x); %> 17 Hello,我是奇数!!! 18 19 </body> 20 </html>
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 <% 3 String path = request.getContextPath(); 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 %> 6 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 7 <html> 8 <head> 9 <base href="<%=basePath%>"> 10 <title>My JSP 'index1.jsp' starting page</title> 11 </head> 12 <body> 13 <% 14 String r=request.getParameter("i"); 15 int x=Integer.parseInt(r); 16 out.print("随机数"+x); %> 17 Hello,我是偶数!!! 18 </body> 19 </html>
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 <% 3 String path = request.getContextPath(); 4 String basePath = request.getScheme() + "://" 5 + request.getServerName() + ":" + request.getServerPort() 6 + path + "/"; 7 %> 8 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 9 <html> 10 <head> 11 <base href="<%=basePath%>"> 12 <title>My JSP 'index1.jsp' starting page</title> 13 </head> 14 <body> 15 <% 16 int i = (int) (Math.random() * 10 + 1); 17 if (i % 2 == 0) { 18 %> 19 <jsp:forward page="ou.jsp"> 20 <jsp:param value="<%=i %>" name="i" /> 21 </jsp:forward> 22 <% 23 } else { 24 %> 25 <jsp:forward page="ji.jsp"> 26 <jsp:param value="<%=i %>" name="i" /> 27 </jsp:forward> 28 <% 29 } 30 %> 31 </body> 32 </html>