Skip to content

Commit

Permalink
Merge pull request #421 from zhengde/master
Browse files Browse the repository at this point in the history
#4 #66 提交实验代码
  • Loading branch information
zengsn authored Nov 10, 2016
2 parents 0f5823e + 0b8007e commit ec7ee25
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
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);
}

}



66 changes: 66 additions & 0 deletions jweb/web/1414080902124/index.jsp
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>
17 changes: 17 additions & 0 deletions jweb/web/1414080902124/info.jsp
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>

0 comments on commit ec7ee25

Please sign in to comment.