DETAILED DESCRIPTION custom view SpringMVC execution

Foregoing execution request, as detailed: https: //blog.csdn.net/S_Tian/article/details/104365603

Now in doDispatch method of DispatcherServlet in.

Here Insert Picture Description
Then we click into processDispatchResult method, if unusual exception processing is performed (after analysis of exception handling) Here
Here Insert Picture Description
render method of DispatcherServlet have a view.render, if we view a custom inherited from the View class, then our self defines the view class will override this render method, when you perform a custom view when he entered view.render from here directly to our custom view class

Since we view this custom class does not directly implement the View class, but inherits AbstractXlsView class, so we'll enter our custom class recent implementation class associated with the View abstract class (first class that implements the View class) the render of method (ie AbstractView class, AbstractXlsView class, ExcelView class, as I wrote in the order, who should implement the render method to use who render method)
Here Insert Picture Description
(InternalResourceView we also realized that renderMergedOutputModel method that app in Spirng file after .xml configured in InternalResourceViewResolver, we are dealing with a non-custom view class should enter the process InternalResourceView class)
Here Insert Picture Description
the buildExcelDocument is a method to generate a table, but also our ability to customize the view class to be achieved, and here we rewrite it
Here Insert Picture Description
to our custom view is created an Excel spreadsheet, and outputs it
Here Insert Picture Description
after completing rewriting method renderWorkbook then performing down
Here Insert Picture Description
in response to the process

Here Insert Picture Description

Published 101 original articles · won praise 3 · Views 2230

Guess you like

Origin blog.csdn.net/S_Tian/article/details/104535754