博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Springmvc.xml中的配置
阅读量:3908 次
发布时间:2019-05-23

本文共 560 字,大约阅读时间需要 1 分钟。

Use-default-filter的作用:

属性的默认值为 true,即使用默认的 Filter 进行包扫描,而默认的 Filter 对标有 @Service,@Controller@Repository 的注解的类进行扫描,因为前面说过,我们希望 SpringMVC 只来控制网站的跳转逻辑,所以我们只希望 SpringMVC 的配置扫描 @Controllerce 注解标注的类,不希望它扫描其余注解标注的类,所以设置了 use-default-filters false,并使用 context:include-filter 子标签设置其只扫描带有 @Controller 注解标注的类。

<context:include-filter type="annotation"

            expression="org.springframework.stereotype.Controller" />

扫描标有注解@controller的类

 

<mvc:annotation-driven /> 的作用:

会自动注册DefaultAnnotationHandlerMappingAnnotationMethodHandlerAdapter 两个bean,spring MVC@Controllers分发请求所必须的

转载地址:http://jdqen.baihongyu.com/

你可能感兴趣的文章
dict & set
查看>>
Common Multiple and Least Common Multiple(LCM)
查看>>
Greatest Common Divisor (GCD) - Euclidean algorithm
查看>>
Regular Expression Python
查看>>
大数据处理
查看>>
Mapreduce 通俗版
查看>>
MapReduce Inverted index
查看>>
MapReduce Intro
查看>>
Mapreduce Patterns, Algorithms, and use cases
查看>>
Hadoop interview
查看>>
数据处理问题
查看>>
BloomFilter
查看>>
Bloom Filter - Math deduce
查看>>
Bit Byte Megabyte Gigabyte
查看>>
Bits Bytes and Words
查看>>
Python yield and generator
查看>>
Python yield and iterables
查看>>
Python string find
查看>>
del Statement
查看>>
Python Dict all
查看>>