public String mLoginCheck(String in_id,String in_pw) : 로그인체크 



public Member mGetForSession(String in_id) : 로그인 성공 한 회원 체크 


login_pro.jsp 


<%

       String id = request.getParameter("id");

       String pw = request.getParameter("pw");

      

       Mdao mdao = new Mdao();

       String loginresult = mdao.mLoginCheck(id, pw);

      

       switch(loginresult){

       case "로그인성공" :

             Member m = mdao.mGetForSession(id);

             session.setAttribute("S_NAME", m.getM_name());

             session.setAttribute("S_LEVEL", m.getM_level());

             session.setAttribute("SID", m.getM_id());

             %><script language="javascript">

                    alert("로그인성공");

                    location.href = "<%= request.getContextPath() %>/index.jsp";

             </script>

             <%

             break;

       case "비밀번호불일치" :

             %>

             <script language="javascript">

                    alert("비밀번호불일치");

                    location.href = "<%= request.getContextPath() %>/index.jsp";

             </script>

             <%

             break;

       case "아이디불일치" :

             %>

             <script language="javascript">

                    alert("아이디불일치");

                    location.href = "<%= request.getContextPath() %>/index.jsp";

             </script>

             <%

             break;

       }

%>

 


+ Recent posts