我对 Spring 和 Portlet 很陌生。我想使用 jqgrid 来显示一些列表。我正在尝试调用控制器中的一个方法,该方法用@RequestMapping 注释,但没有调用该方法
我的控制器有以下方法
@Controller(value = "myController")
public class MyController {
@RequestMapping(value="/myURL",method=RequestMethod.GET)
public @ResponseBody MyDTO initItemSearchGrid(RenderResponse response, RenderRequest request){
MyDTO myDto=new MyDTO();
return myDto;
}
}
我使用 AJAX 的 JSP 代码
var urlink="/myURL"; /* myURL is the exact String written in value Attribute of
resourceMapping in Controller*/
$.ajax({
url :urlink,
cache: false,
data:$('#myForm').formSerialize(),
dataType: "json",
type: "GET",
contentType: "application/json; charset=utf-8",
success: function(jsondata){
...
}
});
当上面的 AJAX 代码正在执行时,我的方法没有被调用。