1. 程式人生 > >springMvc錯誤:class path resource [config/spring/springmvc.xml] cannot be opened because it does

springMvc錯誤:class path resource [config/spring/springmvc.xml] cannot be opened because it does

錯誤:class path resource [config/spring/springmvc.xml] cannot be opened because it does not exist

  錯誤原因:找不到我的springmvc.xml,在web.xml中是我引用路徑,
    網上找到問題classpath指向路徑不是resource路徑,所以一直找不到我的xml檔案,

  classpath:到你的class路徑中查詢檔案,

 

  classpath*:不僅包含class的路徑,還包括jar檔案中(class路徑)進行查詢

 

  解決辦法:在classpath後面在上“*” 可解決問題,“classpath*:springmvc.xml”