참조
http://miconblog.com/tc/sohn/563
http://blog.naver.com/PostView.nhn?blogId=kobell9&logNo=90149920026
1. Spring 설정
web.xml 에 아래와 같이 Spring 에서 제공하는 filter를 설정해준다.
(POST를 한글처리를위한 설정)
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
servelt-context.xml 설정
<!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
<beans:property name="contentType" value="text/html; charset=UTF-8" />
</beans:bean>
2. Server 설정
Server.xml
(GET 한글 처리를 위한 설정)
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443" URIEncoding="UTF-8"/>
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"URIEncoding="UTF-8"/>
3. jsp 설정
<%@ page session="false" pageEncoding="UTF-8"%>
6. Eclipse설정
preference->general->workspace UTF-8 Setting
preference->web->CSS UTF-8 Setting
preference->web->HTML UTF-8 Setting
preference->web->JSP UTF-8 Setting
7. JavaScript 설정
GET으로 보낼때 encodeURI() 수행
'프로그래밍 > Spring & MyBatis' 카테고리의 다른 글
[Spring] 스케쥴러 (스프링 웹 크론) (0) | 2018.08.06 |
---|---|
[Spring] 크로스 도메인(CORS) (0) | 2018.08.06 |
[maven] maven spring tomcat7 서버로 자동배포 설정 (0) | 2018.07.05 |
(Jackson) LocalDate, LocalTime, LocalDateTime - Serialize (0) | 2018.07.04 |
(Jackson) LocalDate, LocalTime, LocalDateTime - Deserialize (0) | 2018.07.04 |