# Conflicts: # src/servlet/account/login.java # web/WEB-INF/web.xml # web/webPage/jsFile/login.jswlf
commit
41a590d63a
@ -0,0 +1,32 @@
|
||||
package servlet.account;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.annotation.WebServlet;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import core.user.Student;
|
||||
import core.user.User;
|
||||
|
||||
@WebServlet("/login")
|
||||
public class login extends HttpServlet {
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
String id=request.getParameter("id");
|
||||
String password=request.getParameter("password");
|
||||
if(id=="201630126050"&&password=="823169880")
|
||||
{
|
||||
request.getRequestDispatcher("/service").forward(request,response);
|
||||
}
|
||||
else
|
||||
response.sendRedirect("");
|
||||
}
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 452 KiB After Width: | Height: | Size: 452 KiB |
Before Width: | Height: | Size: 650 KiB After Width: | Height: | Size: 650 KiB |
@ -1,20 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: lenovo
|
||||
Date: 2019/1/9
|
||||
Time: 11:02
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Title</title>
|
||||
<script src="webPage/jsFile/jquery-3.3.1.js" type="text/javascript"></script>
|
||||
<script src="test5.js" type="text/javascript"></script>
|
||||
<script src="updateT.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="tes">holle</div>
|
||||
<div class="tes2">holle</div>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,55 @@
|
||||
|
||||
function showRegister() {
|
||||
$('.register-cont').css('display','block');
|
||||
$('.login-cont').css('display','none');
|
||||
$('.to-register').css( 'display','none');
|
||||
$('.to-login').css( 'display','block');
|
||||
}
|
||||
function showlogin() {
|
||||
$('.register-cont').css('display','none');
|
||||
$('.login-cont').css('display','block');
|
||||
$('.to-register').css( 'display','block');
|
||||
$('.to-login').css( 'display','none');
|
||||
}
|
||||
function isEmpty(e)
|
||||
{
|
||||
|
||||
$('.input-text').each(function () {
|
||||
if($(this).val().length<=0)
|
||||
{
|
||||
e.preventDefault();
|
||||
alert($(this).attr('name')+'不能为空');
|
||||
return false;
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
function isEmpty2(e)
|
||||
{
|
||||
var isem=false;
|
||||
$('.register-input-text').each(function () {
|
||||
if($(this).val().length<=0)
|
||||
{
|
||||
e.preventDefault();
|
||||
alert($(this).attr('name')+'不能为空');
|
||||
isem=true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
)
|
||||
if($('.register-input-text').eq(4).val()!=$('.register-input-text').eq(5)
|
||||
.val()&&!isem)
|
||||
{
|
||||
e.preventDefault();
|
||||
alert('两次密码不同');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$(document).ready(
|
||||
function () {
|
||||
$('.to-register').on('click', showRegister);
|
||||
$('.to-login').on('click', showlogin);
|
||||
$('.submit-style').on('click',isEmpty);
|
||||
$('.register-submit-style').on('click',isEmpty2);
|
||||
})
|
||||
|
@ -1,17 +0,0 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: lenovo
|
||||
Date: 2019/1/9
|
||||
Time: 12:11
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.Date" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
<%!Date date =new Date();%>
|
||||
<div class="testp">时间是:<%=date%></div>
|
||||
</body>
|
||||
</html>
|
@ -1,7 +0,0 @@
|
||||
function test6() {
|
||||
$('.tes').load('server.jsp .testp');
|
||||
|
||||
}
|
||||
$(document).ready(function () {
|
||||
window.setInterval('test6()',1000);
|
||||
});
|
@ -1,7 +0,0 @@
|
||||
function showtime() {
|
||||
var tim=new Date();
|
||||
$('.tes2').html(tim);
|
||||
}
|
||||
$(document).ready(function () {
|
||||
window.setInterval('showtime()',1000);
|
||||
})
|
Loading…
Reference in new issue