看起來我沒有管理讓我的Spring方法與Jquery腳本一起工作。這裏是方法JQuery onBlur腳本仍然不能與方法
@RequestMapping(value="vsfill.html", params = "accountId", method = RequestMethod.GET)
public @ResponseBody String getAccount(@RequestParam("accountId") String accountId) throws JSONException {
logger.debug("getAccount() accountId "+accountId);
String json = null;
String _json = null;
User user = idmClient.getUser(accountId);
HashMap hm = new HashMap();
hm.put("accoountId", user.getAccountId());
//hm.put("givenName", user.getGivenName());
hm.put("callingName", user.getCallingName());
hm.put("email", user.getEmail());
json = JsonUtils.javaToStr(hm);
return json;
}
}
腳本
$("#person").blur(function() {
var accountId =$('#person').val();
$.ajax({
type: 'GET',
url: 'vsfill.html?accountId='+accountId,
dataType: 'json',
data: (accountId),
success: function(data) {
if (data!=null&&data!='') {
$('#responsableName').val(data.callingName);
$('#resposableMail').val(data.Mail);
}
}});
});
我是個新手。
'resposableMail'>在這裏輸入錯字。 'logger.debug(「getAccount()accountId」+ accountId);' - >這得到了loggeed? – ariel 2011-05-10 09:41:52