基于javaweb+springboot的兼职平台系统(java+Springboot+ssm+HTML+maven+Ajax+mysql)
基于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)相关推荐
- 基于javaweb的兼职平台系统(java+springboot+ssm+html+ajax+mysql)
基于javaweb的兼职平台系统(java+springboot+ssm+html+ajax+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/myecli ...
- 基于javaweb的水果生鲜商城系统(java+springboot+mybatis+vue+mysql)
基于javaweb的水果生鲜商城系统(java+springboot+mybatis+vue+mysql) 运行环境 Java≥8.MySQL≥5.7.Node.js≥10 开发工具 后端:eclip ...
- 基于javaweb的人脸识别登录系统(java+springboot+mysql)
基于javaweb的人脸识别登录系统(java+springboot+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/myeclipse/sts等均可配置 ...
- 基于javaweb的在线点餐系统(java+springboot+mybatis+vue+mysql+redis)
基于javaweb的在线点餐系统(java+springboot+mybatis+vue+mysql+redis) 运行环境 Java≥8.MySQL≥5.7.Node.js≥10 开发工具 后端:e ...
- 基于javaweb+mysql的兼职平台系统(java+Springboot+ssm+HTML+maven+Ajax+mysql)
一.项目运行 环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持) 项目技术: HTML ...
- Java项目:兼职平台系统(java+Springboot+ssm+HTML+maven+Ajax+mysql)
源码获取:博客首页 "资源" 里下载! 一.项目运行 环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclisp ...
- 基于javaweb的仿天猫商城系统(java+jsp+springboot+ssm+mysql)
基于javaweb的仿天猫商城系统(java+jsp+springboot+ssm+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/myeclipse/s ...
- 基于javaweb+springboot的在线游戏商城系统(java+Springboot+MyBatis+MySQL+Maven+layui+Jsp)
基于javaweb+springboot的在线游戏商城系统(java+Springboot+MyBatis+MySQL+Maven+layui+Jsp) 一.项目简述 功能包括: 用户管理,游戏商品管 ...
- 基于javaweb的在线网盘系统(java+jsp+springboot+mysql+thymeleaf+ftp)
基于javaweb的在线网盘系统(java+jsp+springboot+mysql+thymeleaf+ftp) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/my ...
最新文章
- mysql smack_super-smack测试mysql性能
- Nginx(九)-- Nginx实际使用配置
- Redis基础数据结构内部实现简单介绍
- 列表,元组,字典类的常见简单方法
- linux drbd同步,DRBD数据镜像主备节点同步数据
- 纯css3云彩动画效果
- 苏宁易购:苏宁控股、苏宁电器合计质押约5.18亿股公司股份
- 一文搞懂隐马尔可夫模型(HMM)
- 保存网站快捷方式到桌面的php代码,转的一个朋友的了,加了点判断
- 计算机组成知识试题及答案,2015年计算机考研:计算机组成原理试题六【附答案】...
- CSS3中很容易混淆的transform,translate,transition。如何去区分,以及综合写法。
- Verilog——计数器
- 人脸识别中的损失函数ArcFace及其实现过程代码(pytorch)--理解softmax损失函数及Arcface
- 深度解析《软文广告经典案例300》
- 韦小宝高超的说谎技巧
- loj6198谢特 后缀数组+并查集+Trie
- ScheduledExecutorService:多线程任务调度
- python web面试题部分汇总
- 嵌入式arm板linux路由表设置
- 熊太行.关系攻略之---正确认识关系和自己
热门文章
- 妙!二十九招驱蚊止痒不再愁
- 【区块链】激活数字资产的蓝海,布比区块链打造新一代价值流通网络,以让数字资产自由流动起来
- 刚毕业女大学生竟和“禽兽”做出这种事
- 限制系统性能瓶颈的因素、衡量系统性能的指标
- 服务器图片默认显示图片,图片上传服务器后被自动旋转
- sharding子查询_分页及子查询
- 蔡琴“银色月光下”南京新年演唱会何不来一场完美的追忆?
- 【华为云-云驻共创】Docker是什么?有哪些应用场景?
- 10.26日永泰姬岩、闽清白岩山穿越,吃农家菜
- 选择供应商时的该与不该