——————————DescriptionStart——————————
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明






基于javaweb的JSP+Servlet校园招聘平台系统(java+mysql+jdbc+servlet+springmvc+html)
一、项目简述 功能: 用户和企业用户的注册登录,简历的筛选查看搜索,应聘信息互动等等。
二、项目运行 环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
Jdbc+ Servlert + SpringMvc + Jsp + css + JavaScript + JQuery + Ajax + Fileupload等等
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| if (i == 1){ jsonObject.put("code",2000); jsonObject.put("msg","waiting verify"); resp.getWriter().print(jsonObject); return; }else { jsonObject.put("code",2000); jsonObject.put("msg","companyId exist"); resp.getWriter().print(jsonObject); return; } } catch (SQLException throwables) { throwables.printStackTrace(); jsonObject.put("code",5000); jsonObject.put("msg","server error"); resp.getWriter().print(jsonObject); return; } }
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { this.doGet(req, resp); } } package com.zhongger.controller;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
public class LoginController extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { JSONObject jsonObject = new JSONObject(); String username = req.getParameter("username"); String password = req.getParameter("password"); resp.setCharacterEncoding("UTF-8");
HttpSession session = req.getSession(); if (StringUtils.isBlank(username) || StringUtils.isBlank(password)) { jsonObject.put("code", 2000); jsonObject.put("flag", "fail"); jsonObject.put("user", null); jsonObject.put("msg", "usernameOrPasswordIsBank"); resp.getWriter().print(jsonObject); return; } password = MyMD5Util.encrypt(password); System.out.println(password); BusinessUserVO businessUserVO = new BusinessUserVO(); businessUserVO.setUsername(username); businessUserVO.setPassword(password); StudentUserVO studentUserVO = new StudentUserVO(); studentUserVO.setUsername(username); studentUserVO.setPassword(password);
String flag1 = null; String flag2 = null; try { flag1 = BusinessUserDao.selectUsername(businessUserVO); if ("ok".equals(flag1)) { BusinessUserDTO businessUserDTO = BusinessUserDao.select(businessUserVO); if (businessUserDTO != null) { jsonObject.put("code", 2000); jsonObject.put("flag", "success"); jsonObject.put("user", businessUserDTO); jsonObject.put("msg", "login_success"); session.setAttribute("businessUser",businessUserDTO); resp.getWriter().print(jsonObject); return;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| if (i>0){ jsonObject.put("code",2000); jsonObject.put("flag","success"); jsonObject.put("msg","add success"); jsonObject.put("data",recruitInformation); resp.getWriter().println(jsonObject); return; } } catch (SQLException e) { e.printStackTrace(); jsonObject.put("code",2000); jsonObject.put("flag","fail"); jsonObject.put("msg","add fail"); resp.getWriter().println(jsonObject); return; } }else if (operate.equals("update")){ String id = req.getParameter("id"); String requirement = req.getParameter("requirement"); HttpSession session = req.getSession(); BusinessVO businessVO = (BusinessVO) session.getAttribute("businessUser"); String companyId = businessVO.getCompanyId(); String companyName = businessVO.getCompanyName(); String salary = req.getParameter("salary"); String deadLine = req.getParameter("deadLine"); String address = req.getParameter("address"); String applyPosition = req.getParameter("applyPosition"); RecruitInformation recruitInformation = new RecruitInformation(Integer.parseInt(id),requirement,companyId,companyName,salary,deadLine,address,applyPosition); try { int update = RecruitInformationDao.update(recruitInformation); if (update>0){ jsonObject.put("code",2000); jsonObject.put("flag","success"); jsonObject.put("msg","update success"); jsonObject.put("data",recruitInformation); resp.getWriter().println(jsonObject); return; } } catch (SQLException e) { e.printStackTrace(); jsonObject.put("code",2000); jsonObject.put("flag","fail"); jsonObject.put("msg","update fail"); resp.getWriter().println(jsonObject); return; } }else if (operate.equals("delete")){
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| resp.getWriter().print(jsonObject); return; } } catch (SQLException throwables) { throwables.printStackTrace(); jsonObject.put("code",5000); jsonObject.put("msg","server error"); resp.getWriter().print(jsonObject); return; } }
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { this.doGet(req, resp); } } package com.zhongger.controller;
public class RegisterController extends HttpServlet { @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String username = req.getParameter("username"); String password = req.getParameter("password"); String rePassword = req.getParameter("rePassword"); password=MyMD5Util.encrypt(password); JSONObject jsonObject = new JSONObject();
StudentUserVO studentUser = new StudentUserVO(); studentUser.setUsername(username); studentUser.setPassword(password); try { String flag2 = StudentUserDao.selectUsername(studentUser);
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| String studentName = split[0]; String studentUsername = split[1]; String recruitInfoId = split[2]; String applyPosition = split[3]; String phoneNum = split[4]; String email = split[5]; Resume resume = new Resume(studentUsername, Integer.parseInt(recruitInfoId), studentName, applyPosition, phoneNum, email, resumeFile); int insert = ResumeDao.insert(resume); if (insert == 1){ jsonObject.put("code",2000); jsonObject.put("msg","add success"); jsonObject.put("flag","success"); jsonObject.put("data",resume); resp.getWriter().print(jsonObject); return; }else { jsonObject.put("code",2000); jsonObject.put("msg","add fail"); jsonObject.put("flag","fail"); jsonObject.put("data",null); resp.getWriter().print(jsonObject); } } catch (FileUploadException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (NumberFormatException e) { e.printStackTrace(); } catch (SQLException throwables) { throwables.printStackTrace(); }
}
@Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { this.doGet(req, resp); } } package com.zhongger.controller;
|
——————————PayStart——————————
项目链接:
https://javayms.github.io?id=021422292105200ee
https://javayms.pages.dev?id=021422292105200ee