嗨,我的电子邮件地址在我的数据库中,例如“[email protected]”,当我检索到它时,我在控制器上获得相同的结果,然后将该对象返回给客户端,我警告我的Java脚本页面的值,“@”正在转换为一些随机字符,并没有给予适当的显示。我该如何解决这个问题。?json将字符转换为随机字符
服务器代码:
enter code here
public AppUser findById(@FormParam("employeeId") String eId){
int id=Integer.parseInt(eId);
AppUser appUser=null;
appUser= evaluatorService.findById(id);
return appUser;
}
同时调试APPUSER它给我正确的数据。
我的客户端代码:
$.ajax({
type : 'GET',
url : 'rest/evaluator/fetchEvaluatorById',
data : {
'employeeId' : employeeId
},
success : function(data) {
$('#evaluatorDetailEdit').dialog({
width: 400,
height: 400,
});
alert(data.email);
$('#employeeId').val(data.employeeId);
$('#name').val(data.name);
$('#lastName').val(data.lastName);
$('#email').val(data.email);
}
});
它是什么样的随机字符? – 2015-03-03 12:25:28
“[email protected]”这是我在数据库中的实际电子邮件ID,我正在收到“n @ yash.com” – 2015-03-03 12:28:13
这不是一个“随机字符”。它是特殊字符的HTML编码。 – 2015-03-03 12:36:40