메뉴 바로가기 검색 및 카테고리 바로가기

한빛미디어

뇌를 자극하는 JSP & Servlet

뇌를 자극하는 JSP & Servlet 질의응답 게시판입니다.

한글 깨짐 현상 ㅠㅠ

2012-08-20

|

by 연지

|

제목 없음.jpg

2620






성격 테스트

        

좋아하는 음식은?



        

                
                
        






-------------------------------------------------------------------------------------

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class AnimalServlet extends HttpServlet{
        public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException{
                String food = request.getParameter("FOOD");
                HttpSession session = request.getSession();
                session.setAttribute("FOOD", food);
                response.setContentType("text/html;charset=euc-kr");
                PrintWriter out = response.getWriter();
                out.println("");
                out.println("성격 테스트");
                out.println("");
                out.println("

좋아하는 동물은?

");
                out.println("
");
                out.println("");
                out.println("");
                out.println("
");
                out.println("");
                out.println("");
        }

}
--------------------------------------------------------------------------------------

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class ResultServlet extends HttpServlet{
        public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws IOException, ServletException{
                HttpSession session = request.getSession();
                String food = (String) session.getAttribute("FOOD");
                response.setContentType("text/html;charset=euc-kr");
                String animal = request.getParameter("ANIMAL");
                session.invalidate();
                
                PrintWriter out = response.getWriter();
                out.println("");
                out.println("성격 테스트");
                out.println("");
                out.println("

성격 테스트

");
                out.printf("당신은 %s와 %s를 좋아하는 성격입니다.",food, animal);
                
                out.println("");
                out.println("");
                
        }

}
------------------------------------------------------------------------------------------

톰캣 conf에서 설정도 했구요 이클립스에서도 했고 한데
저렇게 좋아하는 동물 부분에서만 한글이 깨져요ㅠㅠ 뭐가 잘못된거죠?
댓글 입력
자료실