이런식으로 글깨짐 현상이 발생했길래
HttpServletRequest로도 utf-8 encoding 해보고,
JSP에서 <%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>를 추가해 봐도 모두 다 안됐다ㅠㅠ
그럴땐
web.xml에 들어가서 다음 코드를 추가해주면 된다!
<!-- utf-8 Encoding -->
<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>
'Spring' 카테고리의 다른 글
[Spring/오류] javax.el.PropertyNotFoundException: (0) | 2023.03.09 |
---|---|
[JAVA/Spring/Eclipse] JSON library Jackson 사용 (0) | 2023.02.26 |
[Spring / 오류] Request processing failed; nested exception is org.springframework (0) | 2023.02.17 |
[Spring/Eclipse] lombok 설정 (0) | 2023.02.15 |
[Spring/Eclipse] log4j 설정 (0) | 2023.02.14 |