You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Idar Borlaug (JIRA)" <ji...@apache.org> on 2007/12/11 10:37:34 UTC

[jira] Created: (WW-2368) Message file with UTF-8 encoding while using validator, brakes the encoding.

Message file with UTF-8 encoding while using validator, brakes the encoding.
----------------------------------------------------------------------------

                 Key: WW-2368
                 URL: https://issues.apache.org/struts/browse/WW-2368
             Project: Struts 2
          Issue Type: Bug
          Components: Core Actions, Core Interceptors, XML Validators
    Affects Versions: 2.0.11
         Environment: Linux 64bit, jetty 6.1.6, sun jdk 1.6.0.03
            Reporter: Idar Borlaug


When i use XML validation and put a key in the message, the ouput on the jsp page has broken UTF-8 encoding.

XML validation
<!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0//EN" 
    "http://www.opensymphony.com/xwork/xwork-validator-1.0.dtd">
<validators>
	<field name="status.name">
		<field-validator type="requiredstring">
			<param name="trim">true</param>
			<message key="errors.requiredField.parameter"/>
		</field-validator>
	</field>
</validators>


Filer - web.xml
<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>

JSP: 
<s:fielderror />

message file:
errors.requiredField.parameter=Navnet kan ikke være tomt.

output: 
<ul><li><span class="errorMessage">Navnet kan ikke være tomt.</span></li></ul>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.