package com.shop.controller;
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 com.shop.model.joinDAO;
@WebServlet("/join.do")
public class joinProcessServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public joinProcessServlet() {
super();
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//요청 처리후 응답을 위한 마임타입과 문자셋 설정
response.setContentType("text/html;charset=utf-8");
//응답 결과를 클라이언트에게 보내기 위해서 문자스트림을 생성
PrintWriter out = response.getWriter();
String cmd = request.getParameter("command");
if(cmd.equals("idcheck")){
idCheck(request, response);
} else {
joinProc(request, response);
}
}
joinDAO dao;
protected void idCheck(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
dao = new joinDAO();
String uid = request.getParameter("userid");
boolean success = dao.dupIdCheck(uid);
if(dao.dupIdCheck(uid)){
out.println("이미 사용중인 아이디입니다.");
} else {
out.println("사용 가능한 아이디입니다.");
}
}
protected void joinProc(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
'2020년도 이전 > temp' 카테고리의 다른 글
html5 - 4번 예제 (1) | 2013.08.30 |
---|---|
안드로이드 8월 13일 xml (0) | 2013.08.13 |
joinDAO.java (0) | 2013.08.01 |
join_confirm --- 수정중!! (0) | 2013.07.31 |
서블릿 -- LoginServlet.java (0) | 2013.07.31 |