zoukankan      html  css  js  c++  java
  • JAVA日报

    javaweb(enter.jsp)

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <%
    Object message = request.getAttribute("message");
    if(message!=null && !"".equals(message)){
    %>
    <script type="text/javascript">
    alert("<%=request.getAttribute("message")%>");
    </script>
    <%if(message.equals("密码正确")){ %>
    <%
    request.getRequestDispatcher("user.jsp").forward(request,response);}%>
    <%} %>
    <div style="position:absolute;100%;height:100%;background:#7FDBFF;">
    <div style="position:absolute;text-align:center;color:red;100%;height:20%;top:0;font-size:100px;">
    用户登录
    </div>
    <div style="position:absolute;60%;height:40%;top:30%;left:20%;">
    <form action="UserServlet?method=enter" method="post">
    <table>
    <tr>
    <td>role:</td>
    <td><input type="text" name="role" id="role"style="400px;height:30px"><br></td>
    </tr>
    <tr>
    <td>id:</td>
    <td><input type="text" name="UserID" id="UserID"style="400px;height:30px"><br></td>
    </tr>
    <tr>
    <td>密码:</td>
    <td><input type="password" name="Password" id="password"style="400px;height:30px"><br></td>
    </tr>
    <tr>
    <td><button type="submit" onclick="return check()">登录</button></td>
    <td><a href="userZ.jsp">注册</a></td>
    </tr>
    </table>
    </form>
    </div>
    </div>
    <script type="text/javascript">
    function check() //封装一个<body>中做成点击事件的函数
    {
    if(document.getElementById('UserID').value==''||document.getElementById('role').value==''||document.getElementById('Password').value=='') {
    alert('有为空信息!');
    return false;
    }else {return true;}
    }
    </script>
    </body>
    </html>

  • 相关阅读:
    安卓数据存储(3):SQLite数据库存储
    安卓活动间的传值问题
    JavaScript、jQuery获取radio、checkbox选中的值
    无法连接到VSS资源数据库
    JQuery自定义搜索控件
    UIAlertView使用
    Xcode使用git管理版本
    达乐居视频网前台页面的总结
    Spark环境搭建遇到的问题
    在IE中启动火狐——自定义浏览器链接协议
  • 原文地址:https://www.cnblogs.com/mumulailai/p/14912459.html
Copyright © 2011-2022 走看看