• maven创建web工程Spring配置文件找不到问题解决方案


    使用maven创建web工程,将Spring配置文件applicationContext.xml放在src/resource下,用eclipse编译时提示class path resource [applicationContext.xml] cannot be opened because it does not exist错误。但是用mvn clean package命令编译时成功的。web.xml配置的如下

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml</param-value>
    </context-param>

    用google搜索一下(之前google用不了,用百度搜到蛋疼),发现是由于classpath不是指向resource路径,导致一直找不到文件。需要在classpath后面加个*,这样就解决问题了。

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:applicationContext.xml</param-value>
    </context-param>

  • 相关阅读:
    开发实例
    一张图解析FastAdmin中的表格列表的功能
    fastAdmin进阶
    detailFormatter bootstrapTable
    responseHandler
    自定义PDO封装类
    bootstrapTable
    Thread Safety
    FastAdmin 基本知识流程一栏
    thinkphp5 Request请求类
  • 原文地址:https://www.cnblogs.com/tianSky/p/5308580.html
Copyright © 2020-2023  润新知