jQuery Ajax 请求
<script>
function onSubModulesSelect(id, checkbox) {
alert(id)
if (checkbox.checked) {
$.ajax({
type : 'POST',
url : 'selectedSubModulesRow.html',
data : ({
checkBoxId : id
})
});
}
}
</script>\\\
控制器
@RequestMapping(value =Array( "/selectedSubModulesRow.html"))
@ResponseBody
def selectedSubModuleRow(@RequestParam checkBoxId: String) {
println("Reached..!")
if (checkBoxId != null) {
println( checkBoxId )
}
}
当我按下提交按钮时,它无法解析为控制器方法...浏览器控制台显示一些错误
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/resources/demos/style.css
GET http://localhost:8080/learnware/teacher/selectedSubModulesRow.html?checkBoxId=q1 500 (Internal Server Error) jquery-1.9.1.js:8526