스프링 한글 처리를 위한 인코딩 필터
스프링 한글 깨짐
web.xml
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 32 33 34 35 36 37 38 39 40 | <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <!-- 스프링의 환경설정 파일 로딩 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/root-context.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <!-- 서블릿의 환경설정 --> <servlet> <servlet-name>appServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>appServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <!-- 한글 처리를 위한 인코딩 필터 --> <filter> <filter-name>encoding</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>encoding</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> | cs |
'Spring > study' 카테고리의 다른 글
spring 7강 상품테이블 만들기, File Upload 테스트 (0) | 2019.06.11 |
---|---|
spring 6강 Oracle과 mybatis 연동 실습(자바 코드에 SQL 명령어를 함께 작성하는 방식) (0) | 2019.06.06 |
mybatis #{value}와 ${value} 차이 (0) | 2019.06.05 |
spring 5강 Oracle과 mybatis 연동 실습(회원 목록,등록,수정,삭제) (0) | 2019.06.05 |
Spring Framework (Legacy) spring01 프로젝트 뜯어보기 (0) | 2019.06.03 |