Announcement Announcement Module
Collapse
No announcement yet.
Enforcing Response Character set Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enforcing Response Character set

    Hi,

    I've tried to internationalize my webapplication. Adding every JSP
    Code:
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    does not do the trick, as WebFlow still renders them as latin-1.
    I'm using SWF 2.0.1, and Spring 2.5.4. I render the pages using the Tiles2 engine.
    The pages using only Spring-MVC are rendered correctly, the ones with SWF involved does not.
    Do I have specify the charset somewhere else? Is there a way, through some listeners, or something to enforce utf-8?

  • #2
    Okay, after a day of googling, and some serious source-diving i can answer my question.

    Simply add a filter to your web.xml, with something like this:
    Code:
        <filter>
            <filter-name>CharacterEncodingFilter</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>CharacterEncodingFilter</filter-name>
            <url-pattern>*.htm</url-pattern>
            <url-pattern>*.jsp</url-pattern>
        </filter-mapping >
    It still beats me though why isn't this necessary for pure MVC, only for SWF...
    Last edited by FooLman; Jun 3rd, 2008, 03:05 AM. Reason: spelling and grammar errors

    Comment

    Working...
    X