5
I have a query that is made with Ajax request via jQuery. In the fields when I type a character like "ç" and send the request to the server, it is arriving with the character in another format. Ex: I write in the name field and it arrives in Action like this: §. I’m using Struts 1.
Code called Ajax:
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 didn’t work:
contentType: "application/json; charset=ISO-8859-1",
dataType: "json",
That other 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">
Your application is made with JAVA?
– user6026
Yes it’s done, because?
– adelmo00
It would be nice to pass this information as a tag ... just a recommendation in your question
– user6026
Vc says create a specific tag to solve the problem?
– adelmo00
you put in jquery ajax tag I believe putting java would also be more complete your question, but, I leave it you decide. !!!
– user6026
Got it now. I thought you were talking about the Taglib used in the JEE
– adelmo00