Open Spring source code, we can see a lot of View and ViewResolver classes under org.springframework.web.servlet.view; the View class provides us with some default View, such as org.springframework.web. Servlet.view.Document.Abstract.AbstractExcelView provides a default view, org.springframework.web.servlet.view.Document.AbstractPdfview provides a default PDF format view; configuration through resource files and ViewResolver Use, we can show users our own style view.
There are several packages at org.springframework.web.servlet.view ViewResolver implemented, wherein the default configuration file using InternalResourceViewResolver such as:.
Another ViewResolver is ResourceBundleViewResolver, such as the configuration file as follows:
Other ViewResolver is the same as the above analysis.