1. STS 기준으로 설명
2. webapp/web.xml
</servlet-mapping>
<!-- 한글 utf-8 -->
<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>
</web-app>
3. webapp/WEB-INF/spring/appServlet/servlet-context.xml
<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"/> <!-- 한글 utf-8 -->
</beans:bean>
4. 테스트 해본다.
'Programming > Spring' 카테고리의 다른 글
[Spring/Chrome 80이상 이슈/결제] sameSite=None 적용 (1) | 2020.09.25 |
---|---|
Tomcat에 HTTPS 적용하기 With pkcs12 (0) | 2019.08.21 |
log4j.xml 파일 로그 쌓기 (0) | 2017.03.08 |
[Spring] 에러 코드 관리하기(Enum) (0) | 2017.02.24 |
[Spring] 스케줄러 사용 (0) | 2017.02.14 |