jsp第六周作业

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML>
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
</head>
<body>
    <div align="center">
        <div align="center" style="width: 80% ;">
            <br>
            <div style="background-color: blue ; float: left;width: 83% ;">
                <span style="float: left;">用户注册</span><a href="#"
                    style="float: right; ">帮助</a>
            </div>
            <br> <br>
            <div style="float: right;">
                <a href="index.jsp">1.填写信息</a>&nbsp;&nbsp;<a href="index2.jsp">2.注册成功并激活内容</a>
            </div>
        </div>
    </div>

    <div align="center">
        <div style="width: 80% ;">
            <form action="index2.jsp" method="get">
                <table style="float: left">
                    <tr>
                        <td>用户名:<br>
                        <br>
                        </td>
                        <td><input type="text" name="user" /><br>
                        <br></td>
                    </tr>

                    <tr>
                        <td>密码:<br>
                        <br>
                        </td>
                        <td><input type="password" name="password" /><br>
                        <br></td>
                    </tr>

                    <tr>
                        <td>确认密码:<br>
                        <br>
                        </td>
                        <td><input type="password" name="password2" /><br>
                        <br></td>
                    </tr>

                    <tr>
                        <td>性别<br>
                        <br>
                        </td>
                        <td><input type="radio" name="sex" value="boy" /><input
                            type="radio" name="sex" value="girl" /><br>
                        <br></td>
                    </tr>

                    <tr>
                        <td>电子邮件<br>
                        <br>
                        </td>
                        <td><input type="email" name="email"><br>
                        <br></td>
                    </tr>
                    <tr>

                        <td>出生日期<br>
                        <br>
                        </td>
                        <td><input type="date" name="date"><br>
                        <br></td>
                    </tr>

                    <tr>
                        <td colspan="2" align="right"><input type="submit"
                            value="同意以下协议条款并提交"></td>
                    </tr>
                </table>
            </form>
            <br> <br> <br> <br> <br> <br> <br>
            <br> <br> <br> <br>
            <br> <br> <br> <br>
            <br>

            <textarea cols="50" rows="10" style="float: left;">
一、总则

            </textarea>
        </div>

    </div>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML >
<html>
<head>
<title>My JSP 'index.jsp' starting page</title>
</head>
<body>
    <h1>您注册的信息如下</h1>
    <%
        request.setCharacterEncoding("utf-8");
        String user = request.getParameter("user");
        String password = request.getParameter("password");
        String sex = request.getParameter("sex");
        String email = request.getParameter("email");
        String date = request.getParameter("date");
    %>
    用户名:<%=user%><br> 密码:<%=password%><br> 性别:<%=sex%><br>
    电子邮件:<%=email%><br> 出生日期:<%=date%>
    <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="index2.jsp" method="post">
        求平均值:<br> 姓名:<input type="text" name="name"><br> 性别:<input
            type="radio" name="sex" checked="checked" value="boy"><input
            type="radio" name="sex" value="girl"><br> 
        班级:<select name="banji">
            <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>

 

 

posted @ 2022-04-10 13:25  XLKL  阅读(7)  评论(0编辑  收藏  举报