How to hold japanese characters in SPRING MVC POJO's field

后端 未结 3 1935
忘掉有多难
忘掉有多难 2021-01-16 02:27

I am building web application using

  1. Spring MVC
  2. Spring Security
  3. Hibenate
  4. MySQl

I want to add internationalization supp

3条回答
  •  时光取名叫无心
    2021-01-16 03:22

    You need to use character encoding filter. Spring framework has a built-in character encoding filter. (see here) Simply put it in your web.xml:

    
        encodingFilter
        org.springframework.web.filter.CharacterEncodingFilter
        
            encoding
            UTF-8
        
        
            
            forceEncoding
            true 
        
    
    

    Put this filter in the first place in filter chain to make sure it runs first during request processing and runs last during response processing.

提交回复
热议问题