Opa pessoal…
ja perdi algum tempo tentando descobrir oq estou fazendo errado no meu proj.
Vou postar aqui os códigos que acho que podem gerar o erro de encoding
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<context-param>
<param-name>br.com.caelum.vraptor.encoding</param-name>
<param-value>UTF-8</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>vraptor</filter-name>
<filter-class>br.com.caelum.vraptor.VRaptor</filter-class>
</filter>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.opensymphony.sitemesh.webapp.SiteMeshFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>vraptor</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
<include-prelude>/WEB-INF/jsp/prelude.jspf</include-prelude>
</jsp-property-group>
</jsp-config>
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/jsp/erro/erro404.jsp</location>
</error-page>
</web-app>
decorator.jsp:
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator"
prefix="decorator"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
...
exemplo de uma função Jquery usando a função ajax():
function cadastroCliente(){
$.ajax({
type : 'GET',
url : '/site/cliente/cadastro',
success : function(txt) {
$("#bodyDiv").html(txt)
closeErrorMessage();
},
error : function(txt) {
showErrorMessage(txt.responseText)
}
});
}
O código html que está na página decorator.jsp não apresenta erros na codificação,
mas o html gerado nas requisições AJAX vêem descodificadas…
Alguem conhece o motivo?
Obrigado