HttpServletResponse 的构建

viewandmodel中的数据最终序列化后写入response;

没有的话则不做处理mv != null;

 

@RequestMapping("/login")
  public void login(User user, HttpServletResponse response){
    response.getWriter.write(JSONObject.fromObject(user).toString());
  }

 

@Override

public void render(Map<String, ?> model, HttpServletRequest request, HttpServletResponse response)

throws Exception {

response.setContentType(getContentType());

FileCopyUtils.copy(this.resource.getInputStream(), response.getOutputStream());

}

 

processDispatchResult

// Did the handler return a view to render?

if (mv != null && !mv.wasCleared()) {

render(mv, request, response);

if (errorView) {

WebUtils.clearErrorRequestAttributes(request);

}

}

 

render(Map<String, ?>, HttpServletRequest, HttpServletResponse) : void - org.springframework.boot.autoconfigure.web.servlet.error.DefaultErrorViewResolver.HtmlResourceView

render(ModelAndView, HttpServletRequest, HttpServletResponse) : void - org.springframework.web.servlet.DispatcherServlet

processDispatchResult(HttpServletRequest, HttpServletResponse, HandlerExecutionChain, ModelAndView, Exception) : void - org.springframework.web.servlet.DispatcherServlet

render(ModelAndView, HttpServletRequest, HttpServletResponse) : void - org.springframework.test.web.servlet.TestDispatcherServlet

processDispatchResult(HttpServletRequest, HttpServletResponse, HandlerExecutionChain, ModelAndView, Exception) : void - org.springframework.web.servlet.DispatcherServlet

doDispatch(HttpServletRequest, HttpServletResponse) : void - org.springframework.web.servlet.DispatcherServlet

doService(HttpServletRequest, HttpServletResponse) : void - org.springframework.web.servlet.DispatcherServlet

processRequest(HttpServletRequest, HttpServletResponse) : void - org.springframework.web.servlet.FrameworkServlet

 

posted @ 2019-12-30 19:23  zzfx  阅读(1316)  评论(0编辑  收藏  举报