controller/MemberJoinId.java
페이지 정보
작성자 관리자 작성일 23-03-18 12:14 조회 712 댓글 0본문
package controller.member;
import java.io.IOException;
import java.io.PrintWriter;
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 dao.MemberDAO;
@WebServlet("/member/id_ok")
public class MemberJoinId extends HttpServlet {
private static final long serialVersionUID = 1L;
public MemberJoinId() {
super();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String id = request.getParameter("id");
String msg = "";
MemberDAO dao = new MemberDAO();
int num = dao.loginSelect(id); //존재여부 확인
if(id.length() < 4) {
msg = "4";
}else if(num == 1) {
msg = "1";
}else if(num == 0) {
msg = "0";
}
response.setContentType("html/text; charset=utf-8"); // 출력구문 한글 깨짐 방지
PrintWriter out = response.getWriter();
out.print(msg);
}
}
댓글목록 0
등록된 댓글이 없습니다.