Spring源码片断
程序员文章站
2022-04-16 12:09:15
...
MarshallingView对视图进行渲染的代码
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception { Object toBeMarshalled = locateToBeMarshalled(model); if (toBeMarshalled == null) { throw new ServletException("Unable to locate object to be marshalled in model: " + model); } ByteArrayOutputStream bos = new ByteArrayOutputStream(2048); marshaller.marshal(toBeMarshalled, new StreamResult(bos)); response.setContentType(getContentType()); response.setContentLength(bos.size()); FileCopyUtils.copy(bos.toByteArray(), response.getOutputStream()); }
上一篇: 苹果手机怎么更改隔空投送名字?
下一篇: 如何限制iPhone的使用时间?