I have a query that is done with Ajax request via jQuery. In the fields when I type a character as "ç" and send the request to the server, it is arriving with the character in another format. Ex: I type ç in the name field and it arrives in Action this way: ç. I'm using Struts 1.
Ajax calling code:
var request = $.ajax({
cache: true,
url: "/listagem",
data:{ action: "ajax",
page_num: page_num,
categoria: options.categoria,
estado: options.estado,
cidade: options.cidade,
especialidade: options.especialidade,
nome: options.nome_prestador,
bairro: options.bairro_prestador,
area_atuacao: options.area_atuacao,
}
});
request.done(function(data){
montarHtmlLista(data);
});
I tried to put the following parameters and it did not work:
contentType: "application/json; charset=ISO-8859-1",
dataType: "json",
This one too:
beforeSend: function( xhr ) {
xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
}
My JSP already has the following lines:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="utf-8" isELIgnored="false"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">