jsp第五次作业

<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<html>
<head>
<style type="text/css">
body {
    background-image: url('image/Snap1.jpg');
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
}
</style>

</head>

<body>
    <div style="margin-left: 750;margin-top: 300">
        <form action="Logindoing.jsp" method="post">
            <table border="0">
                <tr height="50">
                    <td>用户名:</td>
                    <td><input type="text" name="user">
                    </td>
                </tr>
                <tr height="50">
                    <td>密码:</td>
                    <td><input type="password" name="password">
                    </td>
                </tr>
                <tr height="50">
                    <td colspan="2" align="center"><input type="submit" value="登录">
                    </td>
                </tr>
            </table>
        </form>
    </div>

</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
    String user = request.getParameter("user");
    String password = request.getParameter("password");
    if (user.equals("lucky") && password.equals("123456")) {
        request.getRequestDispatcher("LoginYes.jsp").forward(request,
                response);
    } else {
        request.getRequestDispatcher("Login.jsp").forward(request,
                response);
    }
%>
<html>
<head>

</head>

<body>
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>

<html>
<head>
<style type="text/css">
div {
text-align: center;
margin-top: 300;
font-size: 40;
color:blue
}
</style>

</head>

<body>
    <div>你好:Lucky!</div>
</body>
</html>

猜你喜欢

转载自www.cnblogs.com/xf981107/p/12587627.html
今日推荐