基于javaweb+springboot的兼职平台系统(java+Springboot+ssm+HTML+maven+Ajax+mysql)
一、项目运行

环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)

项目技术:
HTML +Springboot+ SpringMVC + MyBatis + ThymeLeaf + JavaScript + JQuery + Ajax + maven等等.





适用

课程设计,大作业,毕业设计,项目练习,学习演示等

            jsonObject.put("user", null);jsonObject.put("msg", "usernameIsNotExist");//密码错误resp.getWriter().print(jsonObject);return;} catch (SQLException throwables) {throwables.printStackTrace();}return;}@Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {doGet(req, resp);}
}
管理员登录控制层:
public class AdminLoginController extends HttpServlet {
        }}@Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {this.doGet(req, resp);}
}
登录控制层:
/*** @Author yy* @Description 登录* @Date 2022.2.17*/
public class LoginController extends HttpServlet {@Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {JSONObject jsonObject = new JSONObject();String username = req.getParameter("username");
public class AdminLoginController extends HttpServlet {@SneakyThrows@Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {String username = req.getParameter("username");String password = req.getParameter("password");password = MyMD5Util.encrypt(password);JSONObject jsonObject = new JSONObject();HttpSession session = req.getSession();Admin admin = new Admin(username, password);Admin adminFromDB = AdminDao.findByUsernamePassword(admin);if (adminFromDB!=null){jsonObject.put("code",2000);jsonObject.put("msg","login_success");jsonObject.put("admin",adminFromDB.getUsername());
                sb.append(string+"&&");}else {String[] split = sb.toString().split("&&");String studentName = split[0];String studentUsername = split[1];String recruitInfoId = split[2];String path=req.getServletContext().getRealPath("/");String fieldName = studentName+"_"+studentUsername+"_"+recruitInfoId+"_"+item.getName();String filePath = path+fieldName;resumeFile = fieldName;File file = new File(filePath);BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);FileOutputStream fileOutputStream = new FileOutputStream(file);int line;while ((line = bufferedInputStream.read())!=-1){fileOutputStream.write(line);}
            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);}}@Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {this.doGet(req, resp);}
}
 * @Description 登录* @Date 2022.2.17*/
public class LoginController extends HttpServlet {@Overrideprotected 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;}
                    resp.getWriter().print(jsonObject);return;} else {jsonObject.put("code", 2000);jsonObject.put("flag", "fail");//登录失败jsonObject.put("user", null);jsonObject.put("msg", "passwordError");//密码错误resp.getWriter().print(jsonObject);return;}}//用户名不存在,前往注册jsonObject.put("code", 2000);jsonObject.put("flag", "fail");//登录失败
                String studentName = split[0];String studentUsername = split[1];String recruitInfoId = split[2];String path=req.getServletContext().getRealPath("/");String fieldName = studentName+"_"+studentUsername+"_"+recruitInfoId+"_"+item.getName();String filePath = path+fieldName;resumeFile = fieldName;File file = new File(filePath);BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);FileOutputStream fileOutputStream = new FileOutputStream(file);int line;while ((line = bufferedInputStream.read())!=-1){fileOutputStream.write(line);}fileOutputStream.flush();fileOutputStream.close();
        StringBuffer sb = new StringBuffer();String resumeFile = null;for (FileItem item : items) {String name = item.getFieldName();InputStream inputStream = item.getInputStream();if (!name.equals("resumeFile")){String string = item.getString();string = new String(string.getBytes("ISO8859_1"), StandardCharsets.UTF_8);sb.append(string+"&&");}else {String[] split = sb.toString().split("&&");String studentName = split[0];String studentUsername = split[1];String recruitInfoId = split[2];String path=req.getServletContext().getRealPath("/");String fieldName = studentName+"_"+studentUsername+"_"+recruitInfoId+"_"+item.getName();String filePath = path+fieldName;resumeFile = fieldName;File file = new File(filePath);BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);
        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);
        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;} else {jsonObject.put("code", 2000);
}
登录控制层:
/*** @Author yy* @Description 登录* @Date 2022.2.17*/
public class LoginController extends HttpServlet {@Overrideprotected 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;
            jsonObject.put("msg", "usernameIsNotExist");//密码错误resp.getWriter().print(jsonObject);return;} catch (SQLException throwables) {throwables.printStackTrace();}return;}@Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
                sb.append(string+"&&");}else {String[] split = sb.toString().split("&&");String studentName = split[0];String studentUsername = split[1];String recruitInfoId = split[2];String path=req.getServletContext().getRealPath("/");String fieldName = studentName+"_"+studentUsername+"_"+recruitInfoId+"_"+item.getName();String filePath = path+fieldName;resumeFile = fieldName;File file = new File(filePath);BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);FileOutputStream fileOutputStream = new FileOutputStream(file);int line;while ((line = bufferedInputStream.read())!=-1){fileOutputStream.write(line);}fileOutputStream.flush();
        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);
    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();
            jsonObject.put("code",2000);jsonObject.put("msg","add fail");jsonObject.put("flag","fail");jsonObject.put("data",null);resp.getWriter().print(jsonObject);}}@Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {this.doGet(req, resp);
        this.doGet(req, resp);}
}提交个人简介控制层:
public class SubmitResumeController extends HttpServlet {@SneakyThrows@Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {JSONObject jsonObject = new JSONObject();DiskFileItemFactory factory = new DiskFileItemFactory();
                String filePath = path+fieldName;resumeFile = fieldName;File file = new File(filePath);BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream);FileOutputStream fileOutputStream = new FileOutputStream(file);int line;while ((line = bufferedInputStream.read())!=-1){fileOutputStream.write(line);}fileOutputStream.flush();fileOutputStream.close();bufferedInputStream.close();}}String[] split = sb.toString().split("&&");String studentName = split[0];String studentUsername = split[1];String recruitInfoId = split[2];
                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;} else {jsonObject.put("code", 2000);jsonObject.put("flag", "fail");//登录失败jsonObject.put("user", null);jsonObject.put("msg", "passwordError");//密码错误resp.getWriter().print(jsonObject);return;}}flag2 = StudentUserDao.selectUsername(studentUserVO);if ("ok".equals(flag2)) {//学生用户名存在StudentUser studentUser = StudentUserDao.select(studentUserVO);
                }}flag2 = StudentUserDao.selectUsername(studentUserVO);if ("ok".equals(flag2)) {//学生用户名存在StudentUser studentUser = StudentUserDao.select(studentUserVO);if (studentUser != null) {jsonObject.put("code", 2000);jsonObject.put("flag", "success");//登录成功jsonObject.put("user", studentUser);jsonObject.put("msg", "login_success");session.setAttribute("studentUser",studentUser);resp.getWriter().print(jsonObject);return;} else {jsonObject.put("code", 2000);jsonObject.put("flag", "fail");//登录失败jsonObject.put("user", null);jsonObject.put("msg", "passwordError");//密码错误resp.getWriter().print(jsonObject);return;}
        for (FileItem item : items) {String name = item.getFieldName();InputStream inputStream = item.getInputStream();if (!name.equals("resumeFile")){String string = item.getString();string = new String(string.getBytes("ISO8859_1"), StandardCharsets.UTF_8);sb.append(string+"&&");}else {String[] split = sb.toString().split("&&");String studentName = split[0];String studentUsername = split[1];String recruitInfoId = split[2];String path=req.getServletContext().getRealPath("/");String fieldName = studentName+"_"+studentUsername+"_"+recruitInfoId+"_"+item.getName();String filePath = path+fieldName;resumeFile = fieldName;File file = new File(filePath);
            flag2 = StudentUserDao.selectUsername(studentUserVO);if ("ok".equals(flag2)) {//学生用户名存在StudentUser studentUser = StudentUserDao.select(studentUserVO);if (studentUser != null) {jsonObject.put("code", 2000);jsonObject.put("flag", "success");//登录成功jsonObject.put("user", studentUser);jsonObject.put("msg", "login_success");session.setAttribute("studentUser",studentUser);resp.getWriter().print(jsonObject);return;} else {jsonObject.put("code", 2000);jsonObject.put("flag", "fail");//登录失败jsonObject.put("user", null);jsonObject.put("msg", "passwordError");//密码错误resp.getWriter().print(jsonObject);return;}}//用户名不存在,前往注册jsonObject.put("code", 2000);jsonObject.put("flag", "fail");//登录失败
            jsonObject.put("msg","login_success");jsonObject.put("admin",adminFromDB.getUsername());jsonObject.put("flag","success");resp.getWriter().print(jsonObject);session.setAttribute("admin",adminFromDB);return;}else {jsonObject.put("code",2000);jsonObject.put("msg","no admin");jsonObject.put("admin",null);jsonObject.put("flag","fail");resp.getWriter().print(jsonObject);return;}}@Override
        JSONObject jsonObject = new JSONObject();DiskFileItemFactory factory = new DiskFileItemFactory();ServletFileUpload upload = new ServletFileUpload(factory);req.setCharacterEncoding("UTF-8");upload.setHeaderEncoding("UTF-8");List<FileItem> items = upload.parseRequest(req);StringBuffer sb = new StringBuffer();String resumeFile = null;for (FileItem item : items) {String name = item.getFieldName();InputStream inputStream = item.getInputStream();if (!name.equals("resumeFile")){String string = item.getString();string = new String(string.getBytes("ISO8859_1"), StandardCharsets.UTF_8);
        ServletFileUpload upload = new ServletFileUpload(factory);req.setCharacterEncoding("UTF-8");upload.setHeaderEncoding("UTF-8");List<FileItem> items = upload.parseRequest(req);StringBuffer sb = new StringBuffer();String resumeFile = null;for (FileItem item : items) {String name = item.getFieldName();InputStream inputStream = item.getInputStream();if (!name.equals("resumeFile")){String string = item.getString();string = new String(string.getBytes("ISO8859_1"), StandardCharsets.UTF_8);sb.append(string+"&&");}else {String[] split = sb.toString().split("&&");String studentName = split[0];String studentUsername = split[1];String recruitInfoId = split[2];String path=req.getServletContext().getRealPath("/");
            resp.getWriter().print(jsonObject);return;} catch (SQLException throwables) {throwables.printStackTrace();}return;}@Overrideprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {doGet(req, resp);}
}
管理员登录控制层:
public class AdminLoginController extends HttpServlet {@SneakyThrows@Overrideprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {String username = req.getParameter("username");String password = req.getParameter("password");password = MyMD5Util.encrypt(password);JSONObject jsonObject = new JSONObject();HttpSession session = req.getSession();

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

基于javaweb+springboot的兼职平台系统(java+Springboot+ssm+HTML+maven+Ajax+mysql)相关推荐

  1. 基于javaweb的兼职平台系统(java+springboot+ssm+html+ajax+mysql)

    基于javaweb的兼职平台系统(java+springboot+ssm+html+ajax+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/myecli ...

  2. 基于javaweb的水果生鲜商城系统(java+springboot+mybatis+vue+mysql)

    基于javaweb的水果生鲜商城系统(java+springboot+mybatis+vue+mysql) 运行环境 Java≥8.MySQL≥5.7.Node.js≥10 开发工具 后端:eclip ...

  3. 基于javaweb的人脸识别登录系统(java+springboot+mysql)

    基于javaweb的人脸识别登录系统(java+springboot+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/myeclipse/sts等均可配置 ...

  4. 基于javaweb的在线点餐系统(java+springboot+mybatis+vue+mysql+redis)

    基于javaweb的在线点餐系统(java+springboot+mybatis+vue+mysql+redis) 运行环境 Java≥8.MySQL≥5.7.Node.js≥10 开发工具 后端:e ...

  5. 基于javaweb+mysql的兼职平台系统(java+Springboot+ssm+HTML+maven+Ajax+mysql)

    一.项目运行 环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持) 项目技术: HTML ...

  6. Java项目:兼职平台系统(java+Springboot+ssm+HTML+maven+Ajax+mysql)

    源码获取:博客首页 "资源" 里下载! 一.项目运行 环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclisp ...

  7. 基于javaweb的仿天猫商城系统(java+jsp+springboot+ssm+mysql)

    基于javaweb的仿天猫商城系统(java+jsp+springboot+ssm+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/myeclipse/s ...

  8. 基于javaweb+springboot的在线游戏商城系统(java+Springboot+MyBatis+MySQL+Maven+layui+Jsp)

    基于javaweb+springboot的在线游戏商城系统(java+Springboot+MyBatis+MySQL+Maven+layui+Jsp) 一.项目简述 功能包括: 用户管理,游戏商品管 ...

  9. 基于javaweb的在线网盘系统(java+jsp+springboot+mysql+thymeleaf+ftp)

    基于javaweb的在线网盘系统(java+jsp+springboot+mysql+thymeleaf+ftp) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/my ...

最新文章

  1. 实现一个 能在O(1)时间复杂度 完成 Push、Pop、Min操作的 栈
  2. openapi开放平台架构_适用于所有人的MicroProfile OpenAPI
  3. Centos-挂载和卸载分区-mount
  4. python websocket爬虫_详解python websocket获取实时数据的几种常见链接方式
  5. CF730F. Ber Patio
  6. 将Amazon Cognito与单页面应用程序(Vue.js)集成
  7. vue中 v-show和v-if的区别?
  8. 《密码爆破漏洞详解》——黑客必修的入门操作( 建议收藏 )
  9. Android开发者指南(25) —— Resource Types - Style
  10. 创建简单的maven archetype
  11. sql语句日期格式转换
  12. msvcr71.dll缺失导致Oracle无法连接
  13. QuickTime Component实例
  14. Android 百度地图api 问题 汇总
  15. 厦门大学电子科学系夏令营
  16. Android Studio如何用无线(WiFi)连接手机进行调试
  17. 计算机科班与培训开发编程的区别在哪里?
  18. 前端CDN资源库,解决HTML大屏首次加载慢的问题了,大屏项目必备cdn加速
  19. C++设计模式——桥接模式(高屋建瓴)
  20. Service ‘MongoDB Server‘ (MongDB) failed to start. Verify that you have sufficient privileges to...

热门文章

  1. 深入理解深度学习——Transformer:解码器(Decoder)的多头注意力层(Multi-headAttention)
  2. windows 10 Android SDK下载安装和配置环境
  3. java 字节流 图片_Java下载图片一. 通过字节流传输
  4. java内联函数_Java之内联函数_内联函数的优缺点
  5. Serv-U管理密码破解方案?
  6. 顺利完成由mambo迁移到mambors
  7. 深度学习超分辨率数据处理代码(包含数据增强,随机裁剪,最终保存为h5文件)
  8. CountDownLatch导致的线程阻塞问题及线程池的使用
  9. stm32定时器实验
  10. python tabula 使用方法_Python使用Tabula提取PDF表格数据