有没有办法将数据从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;
}