将数据从Spring Boot Controller(Redirect)传递到角度页面而不传递查询参数?

时间:2019-04-09 06:12:07

标签: angularjs spring-boot

有没有办法将数据从Spring Boot控制器传递到角度页面? 我正在重定向并传递查询参数。可以,但是URL中的字符数有限制。

还有其他方法吗?

@PostMapping(value = "/aalcomplaint/api/complaint/lodge-complaint")
  public ModelAndView lodgeComplaint(final HttpServletRequest request, ModelAndView modelAndView, final RedirectAttributes redirectAttributes) {
    //Map<String, String[]> paramMap = request.getParameterMap();
    StringBuilder sb = new StringBuilder();
    sb.append("policyNumber=").append(request.getParameter("policyNumber"));
    sb.append("&firstName=").append(request.getParameter("firstName"));
    sb.append("&lastName=").append(request.getParameter("lastName"));

    modelAndView.setViewName("redirect:/#/list-complains?&" + sb);
    return modelAndView;
  }

0 个答案:

没有答案