我在ajax控制器中使用以下代码加载html并使用jquery返回,问题是html输出不显示fmt:messages而不是??当我尝试没有ajax调用时,这个JSP工作正常。任何帮助表示感谢。
@Controller("ajaxRequestController")
@RequestMapping(value = "VIEW")
public class AjaxRequestController implements PortletConfigAware {
@ResourceMapping("entitledRequest")
public void getServiceAutoComplete(@RequestParam("accNum") String accNum, ResourceRequest request, ResourceResponse response){
portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/jsp/account_summary.jsp").include(request, response);
}
@Override
public void setPortletConfig(PortletConfig portletConfig) {
this.portletConfig = portletConfig;
}
}
但问题是
答案 0 :(得分:-1)
由于代码中的以下行,view
未正确处理Spring
portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/jsp/account_summary.jsp").include(request, response);
尝试将其更改为下面提到的代码。 (我猜你已经在Spring Context文件中定义了viewResolver
。
@ResourceMapping("entitledRequest")
public String getServiceAutoComplete(@RequestParam("accNum") String accNum, ResourceRequest request, ResourceResponse response){
//portletConfig.getPortletContext().getRequestDispatcher("/WEB-INF/jsp/account_summary.jsp").include(request, response);
return "account_summary";
}