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

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

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

功能说明

基于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等等.

登录控制层:

/**

  • @Author yy

  • @Descriiption 登录

  • @Date 2022.2.17

*/

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;

} 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);

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(“user”, null);

jsonObject.put(“msg”, “usernameIsNotExist”);//密码错误

resp.getWriter().print(jsonObject);

return;

} catch (SQLException throwables) {

throwables.printStackTrace();

return;

@Override

protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {

doGet(req, resp);

管理员登录控制层:

public class AdminLoginController extends HttpServlet {

@SneakyThrows

@Override

protected 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());

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

protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

this.doGet(req, resp);

提交个人简介控制层:

public class SubmitResumeController extends HttpServlet {

@SneakyThrows

@Override

protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

JSONObject jsonObject = new JSONObject();

DiskFileItemFactory factory = new DiskFileItemFactory();

ServletFileUpload upload = new ServletFileUpload(factory);

req.setCharacterEncoding(“UTF-8”);

upload.setHeaderEncoding(“UTF-8”);

List 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(“/”);

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();

bufferedInputStream.close();

String[] split = sb.toString().split(“&&”);

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);

@Override

protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

this.doGet(req, resp);


基于javaweb的兼职平台系统(java+springboot+ssm+html+ajax+mysql)相关推荐

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

    基于javaweb+springboot的兼职平台系统(java+Springboot+ssm+HTML+maven+Ajax+mysql) 一.项目运行 环境配置: Jdk1.8 + Tomcat8 ...

  2. 基于javaweb的仓库管理系统(java+springboot+layui+html+thymeleaf+mysql+实训报告)

    基于javaweb的仓库管理系统(java+springboot+layui+html+thymeleaf+mysql+实训报告) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse ...

  3. 基于javaweb的新闻发布系统(java+springboot+ssm+mysql)

    基于javaweb的新闻发布系统(java+springboot+ssm+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/myeclipse/sts等均可 ...

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

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

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

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

  6. 基于javaweb的在线游戏商城系统(java+springboot+mybatis+mysql+layui+jsp)

    基于javaweb的在线游戏商城系统(java+springboot+mybatis+mysql+layui+jsp) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/ ...

  7. 基于javaweb的私人牙医管理系统(java+springboot+html+layui+echarts+mysql)

    基于javaweb的私人牙医管理系统(java+springboot+html+layui+echarts+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea ...

  8. 基于javaweb的小区物业管理系统(java+springboot+ssm+mysql)

    基于javaweb的小区物业管理系统(java+springboot+ssm+mysql) 运行环境 Java≥8.MySQL≥5.7 开发工具 eclipse/idea/myeclipse/sts等 ...

  9. Java项目:基于遗传算法学校排课系统(java+Springboot+Maven+mybatis+Vue+Mysql)

    源码获取:博客首页 "资源" 里下载! 一.项目简述 本系统功能包括: 排课管理,课程管理,讲师管理,班级管理,学生管理,教学资料,学习文档,在线测试,教材列表,教学设计,帮助中心 ...

最新文章

  1. mediumtext_mediumtext数据类型 | 学步园
  2. win7下安装redies
  3. UBOOT添加命令的执行流程
  4. MySQL数据库Keepalived双主
  5. maven项目修改java编译版本的方式
  6. wine的sys文件具体位置
  7. 一位资深php程序员在北京的面试30个题目
  8. Java中的反射机制
  9. 基于单片机程控滤波放大器增益设计-protues仿真
  10. ACdream - 1073 雷霆战机
  11. 人工智能工程化丨中小企业AI中台落地指南
  12. 某项目的双代号网络图如下所示_某工程项目的双代号网络计划如下图所示(时间单位:月)。...
  13. 不规则图片显示(css实现多边形)
  14. 陀螺年度好文回顾|区块链跨链互操性的意义和应用案例
  15. 高级开发工程师如何快速晋升为架构师?高级开发工程师与架构师到底有啥区别?
  16. mysql当前读和一致性读_数据库 一致性读当前读
  17. WRF模式与Python融合技术在多领域中的应用及精美绘图
  18. 时隔多年,AI船长终于能扬帆启航?
  19. python基础教程视频下载-Python入门到精通视频教程下载[21课程全]
  20. Cream的铁金库能否成为DeFi的流动性后盾?

热门文章

  1. 马云西点军校华为_马云西点军校演讲:世界需要的不是去证明自己多厉害
  2. 深度学习服务器环境搭建
  3. 布比李军:从难以接受到All In,我走过了一条怎样的路
  4. 万亿级数字化市场重塑,谁将引领新一代企业服务生态?
  5. 什么是面向对象思想?面试必答题
  6. input标签readonly属性
  7. 上晚班应该怎样注意饮食
  8. WPF 反射加载Geometry几何图形数据图标
  9. C#获取word版本问题
  10. 壳聚糖(CS)/京尼平(GP)/明胶(G)/β-甘油磷酸钠(β-GP)共混的温敏性水凝胶/壳聚糖载银水凝胶的研究制备