Java 特殊字符在春天不起作用

Java 特殊字符在春天不起作用,java,jsp,spring-mvc,Java,Jsp,Spring Mvc,我已经实现了SpringI18N来支持使用SpringMVC4.1.4的多种语言,但是很少有特殊字符不适用于SpringValidator,相同字符在简单JSP页面中工作正常。 特殊字符,如:é,á,ê。 我在JSP中使用spring消息,如下所示 <spring:message code="sample.message" var="tooltip"/> 用于使用JAVA的Spring验证 public class TestValidator implements Validat

我已经实现了SpringI18N来支持使用SpringMVC4.1.4的多种语言,但是很少有特殊字符不适用于SpringValidator相同字符在简单JSP页面中工作正常。 特殊字符,如:é,á,ê。

我在JSP中使用spring消息,如下所示

<spring:message code="sample.message" var="tooltip"/>
用于使用JAVA的Spring验证

public class TestValidator  implements Validator {

@Autowired
private MessageSource messageSource;

public String getMessage(String key, Object[] arguments){
        try {
            return messageSource.getMessage(key, arguments, LocaleContextHolder.getLocale());
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
        return "";
    }

}
使用上述代码,我正在使用表单提交事件对必填字段进行spring验证,但它在jsp前端错误消息中显示


有人能帮忙吗?

您在页面中使用的是哪种编码?是utf-8吗?是的,我正在使用utf-8。
public class TestValidator  implements Validator {

@Autowired
private MessageSource messageSource;

public String getMessage(String key, Object[] arguments){
        try {
            return messageSource.getMessage(key, arguments, LocaleContextHolder.getLocale());
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
        }
        return "";
    }

}