web.xml 的加载顺序是:ServletContext -> context-param -> listener -> filter -> servlet
学习shiro时,需要配置shiro ,我们需要在filter过滤器之前,先初始化好shiro组件,不然请求认证无法走到shiro,根据web.xml的加载顺序,listener标签中会先于filter标签中的组件,所以我们配置shiro的context文件,单独写一个 applicationContext-shiro.xml , 而不在controller去配置。