• 大小: 32.06MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-11
  • 语言: 数据库
  • 标签: java练习  

资源简介

idea的Maven项目,代码完整,可完美运行,可供参考,欢迎下载,前后端分离,三层架构,可供初学者学习,附有数据库,MySQL

资源截图

代码片段和文件信息

package cn.kgc.guimei.controller;

import cn.kgc.guimei.entity.Seller;
import cn.kgc.guimei.entity.SuperUser;
import cn.kgc.guimei.service.BackLoginService;
import cn.kgc.guimei.service.serviceImpl.BackLoginServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URLEncoder;

@WebServlet(name = “BackLoginServlet“urlPatterns = “/backLoginServlet“)
public class BackLoginServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
        //设置编码
        request.setCharacterEncoding(“utf-8“);
        response.setCharacterEncoding(“utf-8“);
        String action=request.getParameter(“action“);
        PrintWriter out=response.getWriter();
        HttpSession httpSession = request.getSession();
        String path = request.getContextPath()+“/“;
        BackLoginService backLoginService =new BackLoginServiceImpl();
        /**
         * 管理员登录
         */
        if(action!=null&&action.equals(“userLogin“)){
            String userName =request.getParameter(“userLoginName“);
            String userPassword =request.getParameter(“userPassword“);
            SuperUser su=backLoginService.suLogin(userNameuserPassword);
            if (su.getUserLoginName()!=null||su.getUserLoginName()!=““){
                httpSession.setAttribute(“user“su);
                response.sendRedirect(path+“page/index.jsp“);
            }else{
                request.setAttribute(“login““输入的账号错误“);
                request.getRequestDispatcher(path+“Login.jsp“).forward(requestresponse);
            }
            //商家登录
        }else if (action!=null&&action.equals(“cusLogin“)){
            String sellerUser =request.getParameter(“sellerUser“);
            String sellerPassword =request.getParameter(“sellerPassword“);
            Seller sr = backLoginService.srLogin(sellerUsersellerPassword);
            if (sr.getSellerUser()!=null||sr.getSellerUser()!=““){
                httpSession.setAttribute(“seller“sr);
                response.sendRedirect(path+“Seller/index.jsp“);
            }else {
                request.setAttribute(“login““输入的账号错误“);
                request.getRequestDispatcher(path+“Login.jsp“).forward(requestresponse);
            }
        }
    }

    protected void doGet(HttpServletRequest request HttpServletResponse response) throws ServletException IOException {
        doPost(requestresponse);

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        422  2019-04-11 09:08  GuiMei\.git\COMMIT_EDITMSG

     文件        330  2019-04-09 19:21  GuiMei\.git\config

     文件         73  2019-04-09 19:21  GuiMei\.git\description

     文件         98  2019-04-11 09:10  GuiMei\.git\FETCH_HEAD

     文件         23  2019-04-09 19:21  GuiMei\.git\HEAD

     文件        478  2019-04-09 19:21  GuiMei\.git\hooks\applypatch-msg.sample

     文件        896  2019-04-09 19:21  GuiMei\.git\hooks\commit-msg.sample

     文件        189  2019-04-09 19:21  GuiMei\.git\hooks\post-update.sample

     文件        424  2019-04-09 19:21  GuiMei\.git\hooks\pre-applypatch.sample

     文件       1642  2019-04-09 19:21  GuiMei\.git\hooks\pre-commit.sample

     文件       1348  2019-04-09 19:21  GuiMei\.git\hooks\pre-push.sample

     文件       4951  2019-04-09 19:21  GuiMei\.git\hooks\pre-rebase.sample

     文件       1239  2019-04-09 19:21  GuiMei\.git\hooks\prepare-commit-msg.sample

     文件       3611  2019-04-09 19:21  GuiMei\.git\hooks\update.sample

     文件      57010  2019-04-11 14:35  GuiMei\.git\index

     文件        240  2019-04-09 19:21  GuiMei\.git\info\exclude

     文件       1024  2019-04-11 09:08  GuiMei\.git\logs\HEAD

     文件       1024  2019-04-11 09:08  GuiMei\.git\logs\refs\heads\master

     文件        176  2019-04-09 19:21  GuiMei\.git\logs\refs\remotes\origin\HEAD

     文件        476  2019-04-11 09:09  GuiMei\.git\logs\refs\remotes\origin\master

     文件        181  2019-04-11 09:08  GuiMei\.git\objects\00\9aa6f3409d0bdbc08ce006993fbc45bed82fcc

     文件        615  2019-04-11 09:08  GuiMei\.git\objects\01\b69694f0a8991b88b5025762db016d615fc6d4

     文件        228  2019-04-10 20:00  GuiMei\.git\objects\02\206b8e7c8150b15b7ba789cf77c32f86074f6b

     文件       1521  2019-04-10 20:00  GuiMei\.git\objects\02\88ba44af9c8e31b0919013e8398171bd408c03

     文件        228  2019-04-10 20:00  GuiMei\.git\objects\03\3d97d4833814430db9d94c52d2e14549c56033

     文件         44  2019-04-10 20:00  GuiMei\.git\objects\03\9dd16a4921048ead5ae0a41f297061e65af990

     文件         46  2019-04-10 20:01  GuiMei\.git\objects\04\509c8eeb0dc74fad8ae9db7f5cce0f27123d87

     文件        614  2019-04-11 09:08  GuiMei\.git\objects\04\d83d8effd5c83f2e56235051d3176a3ba9058c

     文件        210  2019-04-10 20:00  GuiMei\.git\objects\05\e26b8b12c17fac7a1780d3457ea9ba1edb7848

     文件        228  2019-04-11 09:08  GuiMei\.git\objects\07\13e6c574ec6d8b6a585fa5a320e8b61b7d008b

............此处省略1580个文件信息

评论

共有 条评论

相关资源