jsp第三次做作业
1.听英语
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'audio.jsp' starting page</title> </head> <body bgcolor=Plum> <br>英文课文:</br> <p style="font-family:宋体;font-size:18;color:black"> <jsp:include page="english/english.txt"/> <br>课文音频 :</br> <jsp:include page="audio.jsp"/></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 'audio.jsp' starting page</title> </head> <body bgcolor=Plum> <embed src="english/english.mp3"autostart=false> 课文音频 </embed> </body> </html
2.
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>My JSP 'main.jsp' starting page</title> </head> <body bgcolor=pink> <jsp:include page="circle.jsp"> <jsp:param value="5" name="r"/> </jsp:include> <jsp:include page="ladder.jsp"> <jsp:param value="6" name="top"/> <jsp:param value="10" name="bottom"/> <jsp:param value="7" name="h"/> </jsp:include> </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 'circle.jsp' starting page</title> </head> <body> 被加载的求圆形面积界面: <% String r=request.getParameter("r"); double b=Double.parseDouble(r); double area=3.14*b*b; out.print(area); %> </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 'ladder.jsp' starting page</title> </head> <body> 被加载的求体型面积界面: <% String top=request.getParameter("top"); String bottom=request.getParameter("bottom"); String h=request.getParameter("h"); double s=Double.parseDouble(top); double x=Double.parseDouble(bottom); double g=Double.parseDouble(h); double area=(s+x)*g/2; out.print(area); %> </body> </html>
3.
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> <table height="200" width="800" border="2" align="center"> <tr align="center"> <td colspan="2"><%@ include file="top.jsp"%></td> </tr> <tr align="center"> <td><%@ include file="left.jsp"%></td> <td><%@ include file="main.jsp"%></td> </tr> <tr align="center"> <td colspan="2"><%@ include file="end.jsp"%></td> </tr> 复制代码
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <head> top.jsp的内容包含在这里 </head> <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <head> left.jsp的内容包含在这里 </head> <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <head> end.jsp的内容包含在这里 </head> <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <head> main.jsp的内容包含在这里 </head>
4.
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> <% int num=(int)(Math.random()*10)+1; if(num%2==0){ %> <jsp:forward page="ou.jsp"/> <%} else{%> <jsp:forward page="ji.jsp"/> <%} %> </body> </html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> Hello,我是偶数! </body> </html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> </head> <body> Hello,我是奇数! </body> </html>