Spring. The problem with jsp coding submitting forms



  • There's a jsp file with a uniform: == sync, corrected by elderman == @elder_man ...

    ...

    ...

    File jsp has UTF-8 coding.

    There's a broken text coming at the table.

    1. As the vocal text is quoted:
      The browser displays utf-8.
    2. I use BDE h2, like utf default.
    3. The envelope is correctly decoded by ISO-8859-5
    4. "Set URIEncoding="UTF-8" on your in server.xml." - it did, it doesn't help.
    5. All references: https://github.com/AndrewBryukhov/ClassicWebApplication page edit.jsp
    6. Watching under opera " ie " firefox
    7. I see the curves coming from the browser.

    I had to make a temporary correction, but I don't like it because I don't decide why:
    byte[] isoBytes = author.getBytes("ISO-8859-1);
    author = new String(isoBytes, UTF-8);
    Another strange moment. In an error on the server, tomcat issues my jsp with damaged cyber texts, although the page is displayed in utf8. When they're decoding, the converter says it's utf8.

    Addendum to ConfigurationAdapter:
    @Bean
    public FilterRegistrationBean filterRegistrationBean() {
    CharacterEncodingFilter filter = new CharacterEncodingFilter();
    filterset.Encoding("UTF-8)

        FilterRegistrationBean registrationBean = new FilterRegistrationBean();
    registrationBean.setFilter(filter);
    registrationBean.addUrlPatterns("/*");
    return registrationBean;
    }

    Not helpful.

    It's not about the BDEs because the browser's side of the data is coming. Must be jsp or tomcat.
    So the question is relevant.



  • Council to use utf-8 everywhere and write for start on web.xml:

    <filter>
        <filter-name>encoding-filter</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>encoding-filter</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>

    If it doesn't help adding the prescription:
    http://elwood.su/2012/08/spring-responsebody-%D0%B8-utf-8/


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2