首页 分享 javaweb JAVA JSP流浪狗领养管理系统源码JSP宠物狗管理系统JSP宠物狗领养系统

javaweb JAVA JSP流浪狗领养管理系统源码JSP宠物狗管理系统JSP宠物狗领养系统

来源:萌宠菠菠乐园 时间:2024-08-27 12:43

javaweb JAVA JSP流浪狗领养管理系统源码JSP宠物狗管理系统JSP宠物狗领养系统

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

相关知识

javaweb JAVA JSP流浪狗领养管理系统源码JSP宠物狗管理系统JSP宠物狗领养系统
JSP基于javaweb的宠物领养系统meslk
java/jsp/ssm洗浴预约服务系统【2024年毕设】
java/jsp/ssm流浪动物领养系统【2024年毕设】
java/jsp/ssm宠物托管所托管服务系统【2024年毕设】
【源码及课件分享】Java实战项目之宠物领养系统
基于jsp的宠物领养与服务管理系统(源码+论文+部署讲解等)
[附源码]宠物领养管理系统696729计算机毕设JSP
领养宠物并打印宠物信息java
宠物商城+ssm框架+jsp页面+mysql数据库

网址: javaweb JAVA JSP流浪狗领养管理系统源码JSP宠物狗管理系统JSP宠物狗领养系统 https://www.mcbbbk.com/newsview123816.html

所属分类:萌宠日常
上一篇: 2016年调良宠物培训课程开课啦
下一篇: 宠物网站设计案例

推荐分享