zoukankan      html  css  js  c++  java
  • BeanNameViewResolver

    As described in the documentation, BeanNameViewResolver resolves Views declared as beans. Usually you need it for some

    special-purpose views.Imagine, for example, that one of your controllers should render an Excel spreadsheet. So, you

    subclass AbstractExcelView and implement your custom logic to render a spreadsheet based on model values:

    public class MyExcelView extends AbstractExcelView { ... }

    and declare it as a bean:

    <bean id = "myExcelView" class = "MyExcelView" />

    Then declaring an BeanNameViewResolver makes it available to controllers: when controller returns ModelAndView with view

    name myExcelView, your spreadsheet will be rendered.

    BeanNameViewResolver is usually used in conjunction with some other view resolver that handles "regular" views (so that

    if BeanNameViewResolver can't find a view, the other resolver tries to find it):

    <bean class = "...BeanNameViewResolver">
        <property name = "order" value = "0" />
    </bean>
    
    <bean class = "...InternalResourceViewResolver">
        <property name = "order" value = "1" />
        ...
    </bean>
  • 相关阅读:
    Expedition(POJ 2431)
    spring异步@Async原理和注意问题
    springBoot事件
    spring定时任务原理
    BeanFactory和FactoryBean的区别
    Spring容器启动流程——源码阅读分析
    spring循环依赖
    spring相关的问题和原因分析
    zookeeper原理
    zookeeper的使用
  • 原文地址:https://www.cnblogs.com/yuyutianxia/p/4753651.html
Copyright © 2011-2022 走看看