forked from hzuapps/java-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
jweb/src/edu/hzu/javaweb/labs/se1414080902121/Se1414080902121Servlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package edu.hzu.javaweb.labs.se1414080902121; | ||
|
||
import java.io.IOException; | ||
import java.io.PrintWriter; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
@WebServlet("/1414080902121") | ||
public class Se1414080902121Servlet extends HttpServlet { | ||
private static final long serialVersionUID = 1L; | ||
|
||
|
||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
||
doPost(request,response); | ||
} | ||
|
||
|
||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
|
||
response.setContentType("text/html"); | ||
PrintWriter out = response.getWriter(); | ||
out.println("Sign in Successfully!"); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<%@ page language="java" contentType="text/html; charset=utf-8" | ||
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" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<head> | ||
<base href="<%=basePath%>"> | ||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>菜鸡课表系统</title> | ||
<link href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
|
||
<div class="desu"> | ||
|
||
<h3 class="text-center" style="margin-top: 100px">欢迎使用!</h3> | ||
<div class="row" style="width:300px; margin:auto;height:150px;"> | ||
<form role="form" id="login"> | ||
<div class="form-group"> | ||
<div class="has-feedback" > | ||
<label for="exampleInputEmail1">邮箱</label> | ||
<input type="email" class="form-control" id="exampleInputEmail1" placeholder="Enter your Account"> | ||
|
||
</div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<div class="has-feedback" > | ||
<label for="exampleInputPassword1">密码</label> | ||
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Enter your Password"> | ||
</div> | ||
</div> | ||
<center> | ||
<button type="submit" class="btn btn-success">登陆</button> | ||
|
||
</center> | ||
</form> | ||
</div> | ||
</div> | ||
|
||
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> | ||
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> | ||
<script> | ||
$( "#login" ).submit(function() { | ||
$.ajax({ | ||
dataType: "html", | ||
url: "1414080902121", | ||
type: "post", | ||
success: function(data){ | ||
alert(data); | ||
}, | ||
error: function (XMLHttpRequest, textStatus, errorThrown) { | ||
alert("error"); | ||
} | ||
}); | ||
}); | ||
</script> | ||
|
||
|
||
</body> | ||
</html> |