jsp第六次作业
1.
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>用户注册</title> </head> <body> <form action="MyJsp.jsp" method="post"> 用户名: <input type="text" name="yhm" style="width:200px;" />只能输入字母或数字,4-16个字符<br> <br> 密码: <input type="password" name="mima" style="width:200px;" />密码长度为6-12位<br> <br> 确认密码: <input type="password" name="mima" style="width:200px;" /><br> <br> 性别: <input type="radio" name="xb" value="男" algin="top" checked="ok" />男 <input type="radio" name="xb" value="女" algin="top" />女<br> <br> 电子邮件地址:<input type="email" name="nemail" style="width:200px;" value="918785971@qq.com" />输入正确的Email地址<br> <br> 出生日期: <input type="data" name="year" style="width:90px;" value="2001" />年 <select name="month"> <option selected>四 <option >二</option> <option >三</option> <option >一</option> <option >五</option> <option >六月</option> <option >七月</option> <option >八月</option> <option >九月</option> <option >十月</option> <option >十一月</option> <option >十二月</option> </select>月 <select name="day"> <option selected>23 <option>24</option> <option>25</option> <option>26</option> <option>27</option> <option>28</option> </select> 日<br> <br> <input type="submit" value="同意以下协议条款并提交" size="10px" style="width:200px;" /><br> <textarea name="description" style="overflow-y:autio;">jdakdaljakljdalkjfalfjlhfkalfhkalhkahfakhkahfkafhakfhkahfkasfhfnncmxncxksjdadawjl</textarea> </form> </body> </html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>l</title> </head> <body> 您注册的信息如下:<br> <% request.setCharacterEncoding("utf-8"); String yhm=request.getParameter("yhm"); String mima=request.getParameter("mima"); String xb=request.getParameter("xb"); String nemail=request.getParameter("nemail"); String year=request.getParameter("year"); String month=request.getParameter("month"); String day=request.getParameter("day"); %> 用户名:<%=yhm %><br> 密码:<%=mima %><br> 性别:<%=xb %><br> 电子邮箱:<%=nemail %><br> 出生日期:<%=year %>年<%=month %>月<%=day %>日<br> </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 'two.jsp' starting page</title> </head> <body> <form action="three.jsp" method="post"> 求平均值:<br><br> 姓名: <input type="text" name="name"/><br><br> 性别:<input type="radio" name="xb" value="男" checked="ok"/>男 <input type="radio" name="xb" value="女"/>女<br><br> 班级: <select name="classs"> <option>计算机1902</option> <option>计算机1903</option> </select><br><br> 语文:<input type="text" name="chinese"/><br><br> 数学:<input type="text" name="math"/><br><br> 英语:<input type="text" name="english"/><br><br> <input type="submit" value="提交"> <input type="reset" value="重置"> </form> </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 'three.jsp' starting page</title> </head> <body> 你好! <% request.setCharacterEncoding("utf-8"); String name=request.getParameter("name"); String xb=request.getParameter("xb"); String classs=request.getParameter("classs"); String chinese=request.getParameter("chinese"); String math=request.getParameter("math"); String english=request.getParameter("english"); double chinese1=Integer.parseInt(chinese); double math1=Integer.parseInt(math); double english1=Integer.parseInt(english); double n=(chinese1+math1+english1)/3; %> <%=classs %>的<%=name %>同学!<br><br> 性别:<%=xb %><br><br> 您的各科平均分是:<%=n %> </body> </html>