我们使用带有Liferay6.1的SpringMVC portlet框架来开发门户。我们当前面临的问题是,我们无法通过jsp页面中的ajax调用来调用控制器类中的servResouce方法。
谁能指出解决方案。
发布于 2012-04-09 05:10:21
在Spring控制器中,将资源方法定义为
Public ModelAndView serveResource(ResourceRequest req, ResourceResponse res)
{
...
res.setContentType("application/json; charset=...");
return new ModelAndView("res_page", model);
}并设置您的res_page.jsp响应页面,其中包括:
<% page contentType="text/html; charset=..." %>
<%-- text/html has no effective effect on your response contentType --%>
<% (your taglibs) %>
{
(your data)
}https://stackoverflow.com/questions/9943723
复制相似问题