euro sign not displayed in text field when using jquery tabs plugin

104 Views Asked by At

I see different behaviour when using html input tag vs spring form tab library with Jquery tabs plug in

This works : showing currectly '€' in the text field

<input type="text" value="${requestattr.name}" readonly="readonly"/>

This does not work : shows ascii code &#128; in the text field

<form:input maxlength="40" path="name" readonly="true"/>

Can anyone help what is causing this wierd behaviour?

1

There are 1 best solutions below

0
Periklis Douvitsas On

Try to use the spring character encoding filter. In order to do this, add this into the web.xml file

<!-- Encoding -->
    <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>/*</url-pattern>
    </filter-mapping>

Hope this helps.