开发者社区> 问答> 正文

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

"

<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>

上面这个能生效

"

展开
收起
montos 2020-06-01 22:07:47 497 0
1 条回答
写回答
取消 提交回答
  • "

    配置context-param要配置listener

        <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener
    </listener-class>
    </listener>

     

    ######回复 @Build_Wu : 是的######试了下 监听器配了就可以了 谢谢 再问你下 这两个是匹配存在的吗"
    2020-06-01 22:07:56
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Spring Cloud Alibaba - 重新定义 Java Cloud-Native 立即下载
The Reactive Cloud Native Arch 立即下载
JAVA开发手册1.5.0 立即下载