반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- Spring Boot
- 확장자 사라짐
- 점사라짐
- #jsp
- ServletContextListener
- servlet
- #sendRedirect()
- jsp
- 서블릿
- 서블릿 초기화 파라미터
- #페이지이동
- spring security
- Container
- tomcat
- @PathVariable
- Spring
- oauth
- ServletConfig
- MVC
- spring5
- 웹 어플리케이션 감시
- servletContext
- 한글 처리
- #java
- Servelt
- 데이터 공유
- 디자인패턴
Archives
- Today
- Total
Choi의 고유결계
JSP Servlet: Tomcat 서버 한글 처리 본문
반응형
Tomcat Server 한글처리
톰캣의 기본 문자 처리 방식은 IOS-8859-1 방식을 사용합니다.
개발자가 별도의 한글 인코딩을 하지 않으면 한글은 깨져 보이게 됩니다.
GET,POST 두방식에 따라 한글 처리 방식이 달라지게 됩니다.
GET
Get 방식 요청에는
Server 파일의 server.xml을 수정하여 한글 처리를 합니다.
<Connector URIEncoding="EUC-KR" port="8181" ...>
URIEncoding의 속성 값을 위 코드 처럼 “EUC-KR”라고 수정해줍니다.
POST
Post 방식은 Servlet 클래스에서 doPost() 메소드 안에 request.setCharacterEncoding() 메소드들 이용합니다.
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html; charset=euc-kr");
}
메소드 인자값으로 “text/html; charset=euc-kr”을 써줍니다.
반응형
'Jsp,Servlet' 카테고리의 다른 글
JSP Servlet: response.sendRedirect() 사용시 주의 해야할 점 (0) | 2018.11.28 |
---|---|
JSP Servlet: 웹어플리케이션 감시: ServletContextListener (0) | 2018.09.29 |
JSP Servlet: 데이터 공유 : ServletContext (0) | 2018.09.29 |
JSP Servlet: 특정 서블릿 초기화 파라메터 만들기 (0) | 2018.09.13 |
JSP Servlet: MVC 패턴, Servelt,Container 란? (0) | 2018.07.25 |
Comments