-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #421 from zhengde/master
- Loading branch information
Showing
3 changed files
with
126 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
jweb/src/edu/hzu/javaweb/labs/se1414080902124/Se1414080902124Servlet.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,43 @@ | ||
package com.hzu.javaweb.labs.se1414080902124; | ||
|
||
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 java.io.IOException; | ||
import java.lang.System; | ||
|
||
|
||
/** | ||
* Created by Administrator on 2016/11/6. | ||
*/ | ||
|
||
@WebServlet(name = "Se1414080902124Servlet",urlPatterns = "/change" ) | ||
public class Se1414080902124Servlet extends HttpServlet { | ||
@Override | ||
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
super.doGet(request, response); | ||
} | ||
|
||
@Override | ||
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { | ||
request.setCharacterEncoding("UTF-8"); | ||
response.setContentType("text/html;UTF-8"); | ||
|
||
String name = request.getParameter("name"); | ||
String id = request.getParameter("id"); | ||
String info = ""; | ||
if (name.length() >= 8 || id.length() > 13) { | ||
info = "你所提交的信息不合理,请重新输入"; | ||
} else { | ||
info = "提交成功"; | ||
} | ||
request.setAttribute("Message", info); | ||
request.getRequestDispatcher("/info.jsp").forward(request, response); | ||
} | ||
|
||
} | ||
|
||
|
||
|
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,66 @@ | ||
<%-- | ||
Created by IntelliJ IDEA. | ||
User: Administrator | ||
Date: 2016/11/6 | ||
Time: 22:34 | ||
To change this template use File | Settings | File Templates. | ||
--%> | ||
<%@ page contentType="text/html;charset=UTF-8" language="java" %> | ||
<html> | ||
<head> | ||
<title>惠州学院毕业生就业信息管理系统</title> | ||
<style type="text/css"> | ||
.center { | ||
margin-left: auto; | ||
margin-right: auto; | ||
width: 70%; | ||
/*background-color: #b0e0e6;*/ | ||
text-align: center; | ||
} | ||
.input_location { | ||
width: 20%; | ||
} | ||
</style> | ||
|
||
|
||
</head> | ||
<body> | ||
<h3 align="center">毕业生就业信息录入界面</h3> | ||
|
||
<div class="center"> | ||
<form action="change" method="post"> | ||
<p>姓名: | ||
<input class="input_location" type="text" name="name"> | ||
</p> | ||
|
||
<p>学号: | ||
<input class="input_location" type="text" name="id"> | ||
</p> | ||
|
||
<p>班级: | ||
<input class="input_location" type="text" name="class"> | ||
</p> | ||
|
||
<p>就职城市: | ||
<input class="input_location" type="text" name="city"> | ||
</p> | ||
|
||
<p>就职薪资: | ||
<select class="input_location" name="salary"> | ||
<option value="0-1000元">0-1000元</option> | ||
<option value="1000-2000元">1000-2000元</option> | ||
<option value="2000-3000元">2000-3000元</option> | ||
<option value="3000-4000元">3000-4000元</option> | ||
<option value="4000-5000元">4000-5000元</option> | ||
<option value="5000-6000元">5000-6000元</option> | ||
<option value="6000-7000元">6000-7000元</option> | ||
</select> | ||
</p> | ||
|
||
<input class="input_location" type="submit" name="提交" value="提交"> | ||
|
||
</form> | ||
</div> | ||
</body> | ||
</html> |
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,17 @@ | ||
<%-- | ||
Created by IntelliJ IDEA. | ||
User: Administrator | ||
Date: 2016/11/6 | ||
Time: 16:34 | ||
To change this template use File | Settings | File Templates. | ||
--%> | ||
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %> | ||
<html> | ||
<head> | ||
<title>提交结果页面</title> | ||
</head> | ||
<body> | ||
<h1 style="font-size: xx-large"><%=request.getAttribute("Message")%></h1> | ||
|
||
</body> | ||
</html> |