我想通过ajax调用获得一个值,这就是我所做的,
<input type="text" id="CIMtrek_CI_CER" name="CIMtrek_CI_CER" onblur="getProjectInfo()"/>
这就是我的剧本,
function getProjectInfo(){
var cerNo = document.getElementById('CIMtrek_CI_CER').value;
$.ajax({
type: "POST",
url: "CIMtrek_Project_Information",
data: {
cerNo: cerNo
},
success: function (msg) {
alert("msg : "+msg);
document.getElementById('div_CIMtrek_CI_Used_By_ProjNo').innerHTML=msg;
}
});
}
这就是我的弹簧方法:
@RequestMapping(value = "/CIMtrek_Project_Information", method = RequestMethod.POST)
public String getProjectInfotmation(@RequestParam("cerNo") String cerNo,HttpServletRequest request,HttpServletResponse response) throws Exception {
System.out.println("cerNo : "+cerNo);
return cerNo;
}
controll 转到此方法并打印该值,但它不会在我分配该值的回调中复制。
success: function (msg) {
alert("msg : "+msg);
document.getElementById('div_CIMtrek_CI_Used_By_ProjNo').innerHTML=msg;
}
当我使用萤火虫时,响应是HTTP Status 404 - /ProjectCapexMonitoring/WEB-INF/views/81723.jsp
81723
是添加了我使用此输入提供的输入.jsp
并给出了此异常。
请帮助我解决问题和解决方案。
最好的祝福。