본문 바로가기
Spring

Spring Framework : 한글처리

by autumnly 2017. 2. 20.



web.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    <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>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
cs



추가 후 jsp 파일의 페이지 인코딩을 UTF-8 로 맞춰준다.