Java Spring portlet ajax调用fmt不显示消息

时间:2013-08-02 18:44:34

标签: java spring jquery portlet spring-portlet-mvc

我在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;
    }

}

但问题是

1 个答案:

答案 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";
    }