use of org.springframework.web.servlet.view.JstlView in project leopard by tanhaichao.
the class FileCacheView method createView.
protected JstlView createView(String viewName) {
return new JstlView("/WEB-INF/jsp/" + viewName + ".jsp") {
@Override
protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) throws Exception {
ServletOutputStream output = response.getOutputStream();
ServletContext servletContext = request.getServletContext();
super.setServletContext(servletContext);
CacheResponseWrapper cacheResponseWrapper = new CacheResponseWrapper(response);
// System.err.println("renderMergedOutputModel");
super.renderMergedOutputModel(model, request, cacheResponseWrapper);
byte[] data = cacheResponseWrapper.getResponseData();
String content = new String(data);
response(content);
output.write(data);
output.flush();
}
};
}
Aggregations