第六次作业

1.

 

 

<%@ 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 'index.jsp' starting page</title>
    
  </head>
  
  <body>
    <form action="two.jsp" method='post'>
        用户名:&nbsp&nbsp&nbsp&nbsp<input type='text' name='name' value="name" /> <br>
        密码:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type='password' name='mima' value='mima'/><br>
        确认密码:<input type="password" name='querenmima' value='mima'/><br>
        性别:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="radio" name="sex" checked="checked" value="男"/>boy
        <input type="radio" name="sex" value="女"/>girl<br>
        电子邮件:<input type="text" name="dianziyoujian" value="1234@qq.com"/>请输入正确的Email地址<br>
        出生日期:<input type="text" name="nian" value=""><select name="yue">
        <option value="一"></option>
        <option value="二"></option>
        <option value="三"></option>
        </select><select name="day">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        </select><br>
        <input type="submit" name="ok" value="同意以下条件"><br>
        <textarea rows="10" cols="50">
        所谓必备条款又称主要条款,是指根据合同的性质和当事人的特别约定所必须具备的条款,
        缺少这些条款将影响合同的成立。所谓非必备条款又称普通条款,是指合同的性质在合同中不是必须具备的条款,
        即使合同不具备这些条款也不应当影响合同的成立,如有关履行期限、数量、质量等条款在缺少这些条款情况下,
        完全可以根据《民法典》第五百一十条、第五百一十一条的规定填补漏洞。《民法典》第四百七十条规定,
        合同一般包括当事人的名称和住所、标的、数量、质量等八项条款,有的学者称这是合同的提示条款,
        这些条款中有的是合同必备条款,有的是非必备条款。
        </textarea>
    </form>
</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 'two.jsp' starting page</title>
    
    
  </head>
  
  <body>
    注册为成功!您的信息为:<br>
    <%
    request.setCharacterEncoding("utf-8");
    String name=request.getParameter("name");
    String mima=request.getParameter("mima");
    String sex=request.getParameter("sex");
    String dianziyoujian=request.getParameter("dianziyoujian");
    String nian=request.getParameter("nian");
    String yue=request.getParameter("yue");
    String day=request.getParameter("day");
    
     %>
     
     用户名是:<%=name%><br>
     密码是:<%=mima %><br>
     性别是:<%=sex %><br>
     电子邮件是:<%=dianziyoujian %><br>
     生日是:<%=nian %><%=yue %><%=day %><br>
      
  </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 'index.jsp' starting page</title>
    
  </head>
  
  <body>
  <form action="two.jsp" method="post">
    求平均值:<br>
    姓名:<input type="text" name="name" value="name"><br>
    性别:<input type="radio" name="sex" checked="checked" value="boy"><input type="radio" name="sex" value="girl"><br>
    班级:<select name="class">
    <option value="1">1932301</option>
    <option value="2">1932302</option>
    </select><br>
    语文:<input type="text" name="yu" ><br>
    数学:<input type="text" name="shu" ><br>
    英语:<input type="text" name="ying" ><br>
    <input type="submit" value="提交" >
    <input type="reset" value="重置">
    </form>
  </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 'two.jsp' starting page</title>
       
  </head>
  
  <body>
    <%
    request.setCharacterEncoding("utf-8");
    String name=request.getParameter("name");
    String sex=request.getParameter("sex");
    String clas=request.getParameter("class");
    String yu=request.getParameter("yu");
    String shu=request.getParameter("shu");
    String ying=request.getParameter("ying");
     double a=Integer.parseInt(yu);
     double b=Integer.parseInt(shu);
     double c=Integer.parseInt(ying);
     double d=(a+b+c)/3;
     %>
     你好!<%=clas%>班的<%=name %>同学!<br>
     性别:<%=sex %><br>
     您各科平均分是:<%=d %>
  </body>
</html>

 

posted @ 2022-04-08 14:51  叶鑫宇  阅读(5)  评论(0编辑  收藏  举报