본문 바로가기
Web/JSP

JSP #15 Servlet에서 입력값 한글 지원

by 언덕너머에 2015. 2. 5.

- get 방식

 

Tomcat Server 설정파일인 server.xml파일에 <Connector>태그에 다음값을 추가한다.

URIEncoding="UTF-8"

예)

  <Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1"
   redirectPort="8443" URIEncoding="UTF-8"/>

 

* Tomcat Server 실행중이라면 ReStart 해줘야 함.

 

- post 방식

request.setCharacterEncoding("UTF-8"); 추가

예)

 protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  request.setCharacterEncoding("UTF-8");
  
  ......
 }

'Web > JSP' 카테고리의 다른 글

JSP #17 JSTL-3 fmt 라이브러리  (0) 2015.02.12
JSP #16 sendRedirect & forward  (0) 2015.02.06
JSP #14 Spring - 1 Spring Framework  (0) 2015.01.09
JSP #13 JSTL-2 core 라이브러리  (0) 2015.01.05
JSP #12 JSTL-1  (0) 2015.01.05