码迷,mamicode.com
首页 > 编程语言 > 详细

用Java制作简单的登录界面

时间:2017-08-17 10:36:24      阅读:196      评论:0      收藏:0      [点我收藏+]

标签:key   password   htm   import   lan   w3c   star   val   port   

<%@ 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 ‘login.jsp‘ starting page</title>
    
    
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">
    <!--
    <link rel="stylesheet" type="text/css" href="styles.css">
    -->
    <script type="text/javascript">
    function Login(){
    var form = document.forms[0];
    form.action = "<%=basePath%>user/login";
    form.method = "post";
    form.submit();
    }    
    </script>
  </head>
 
  <body>
    <form action="" name="loginForm">
        用户名:<input type="text" name="username" id="username"
        placeholder="请输入账户" required="required"/>
        <font color="red">${unameErr }</font>
        <br/>
        密    码:<input type="password" name="pwd" id="pwd"
        placeholder="请输入密码" required="required"/>
        <font color="red">${pwdErr }</font>
        <br/>    
        <input type="button" value="登录" onclick="Login()"/>    
    </form>
  </body>
</html>

用Java制作简单的登录界面

标签:key   password   htm   import   lan   w3c   star   val   port   

原文地址:http://www.cnblogs.com/xm-ku6/p/7377234.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!