开发者社区 问答 正文

spring mvc 配置问题 大神求助(web.xml里面的配置):配置报错 

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:/spring/spring-context-redis.xml</param-value>
</context-param>
上面这个配置不生效
init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:/spring/spring-mvc.xml,classpath*:/spring/spring-context-redis.xml</param-value>
</init-param>
上面这个能生效

展开
收起
kun坤 2020-06-02 17:17:41 511 分享 版权
1 条回答
写回答
取消 提交回答
  • 配置context-param要配置listener

        <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>
     ######回复 @Build_Wu : 是的######试了下 监听器配了就可以了 谢谢 再问你下 这两个是匹配存在的吗

    2020-06-02 17:19:04
    赞同 展开评论