From 0b8007eb5831109fc92ed5a5ebce84455f495147 Mon Sep 17 00:00:00 2001 From: zhengde Date: Mon, 7 Nov 2016 13:43:37 +0800 Subject: [PATCH] =?UTF-8?q?#4=20#66=20=E6=8F=90=E4=BA=A4=E5=AE=9E=E9=AA=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Se1414080902124Servlet.java | 43 ++++++++++++ jweb/web/1414080902124/index.jsp | 66 +++++++++++++++++++ jweb/web/1414080902124/info.jsp | 17 +++++ 3 files changed, 126 insertions(+) create mode 100644 jweb/src/edu/hzu/javaweb/labs/se1414080902124/Se1414080902124Servlet.java create mode 100644 jweb/web/1414080902124/index.jsp create mode 100644 jweb/web/1414080902124/info.jsp diff --git a/jweb/src/edu/hzu/javaweb/labs/se1414080902124/Se1414080902124Servlet.java b/jweb/src/edu/hzu/javaweb/labs/se1414080902124/Se1414080902124Servlet.java new file mode 100644 index 00000000..1e55a04d --- /dev/null +++ b/jweb/src/edu/hzu/javaweb/labs/se1414080902124/Se1414080902124Servlet.java @@ -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); + } + +} + + + diff --git a/jweb/web/1414080902124/index.jsp b/jweb/web/1414080902124/index.jsp new file mode 100644 index 00000000..2c981a5d --- /dev/null +++ b/jweb/web/1414080902124/index.jsp @@ -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" %> + + + 惠州学院毕业生就业信息管理系统 + + + + + +

毕业生就业信息录入界面

+ +
+
+

姓名: + +

+ +

学号: + +

+ +

班级: + +

+ +

就职城市: + +

+ +

就职薪资: + +

+ + + +
+
+ + diff --git a/jweb/web/1414080902124/info.jsp b/jweb/web/1414080902124/info.jsp new file mode 100644 index 00000000..260655bc --- /dev/null +++ b/jweb/web/1414080902124/info.jsp @@ -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" %> + + + 提交结果页面 + + +

<%=request.getAttribute("Message")%>

+ + +