我在Liferay 6.1中使用SpringMVC portlet。我试图让从Tha JSP Ajax调用,但该方法没有得到所谓的,我得到了如下错误在Liferay 6.1中没有使用SpringMVC portlet调用Ajax方法
未能加载资源的服务器用404(未找到)状态
回答我的JSP AJAX方法是
jQuery.ajax({
url:'<portlet:resourceURL id="ajax" ></portlet:resourceURL>',
data: {id:data},
type: 'POST',
datatype:'json',
success: function(respData) {
alert(respData);
jQuery('#farmerProfile').html(respData);
}
});
,并在控制器类我servResource方法签名是
@ResourceMapping(value="ajax")
public void serveResource(
PortletConfig config, ResourceRequest request, ResourceResponse response)
throws Exception {
我的控制器类实现
org.springframework.web.portlet.mvc.Controller interface
任何人都可以看到它吗? 谢谢