idea之resource配置

时间:2023-03-09 05:16:40
idea之resource配置

1、问题

在idea中配置springmvc项目,用hibernate管理数据库,在web.xml中作如下配置:

<!--配置hibernate数据库连接-->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>

此时<param-value>classpath:applicationContext.xml</param-value>报红,启动项目汇报错。

2、解决方案

找到file----Project Structure做下图操作

idea之resource配置