I am getting issue for polish characters in ajax call. In alert shown in below code, polish characters are not coming properly.
$.ajax({
type: "GET",
url: "/module/getAllApps.htm",
encoding:"UTF-8",
contentType:"application/x-www-form-urlencoded; charset=UTF-8",
async: true,
success : function(response) {
if(response != null && response != "" && response!= '' && response != 'null'){
var appList = JSON.parse(response);
for(var i=0; i<appList.length; i++){
var module = appList[i];
alert(module.title);
}
}
},
error : function(e){
console.log('Error: ' + e);
}
});
Below is method from Controller class
public void getAllApps(HttpServletRequest request, HttpServletResponse response){
Gson gson = new Gson();
List<Module> moduleList = moduleDao.getAllActiveModulesByDomain(domain.getDomainId());
try {
if(moduleList != null && moduleList.size()> 0){
response.getWriter().print(gson.toJson(moduleList));
} catch (Exception e) {
e.printStackTrace();
}
}