<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
配置contextconfigLocation的文件位置 <!-- Spring配置文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
你如果是maven項目的話applicationContext.xml可以放在src/main/resources下。
想要看詳細解釋的話可以按CTRL+鼠標左擊,就可以進入源碼。
解決方法:jar文件沒有同步發佈到自己項目的lib目錄中 項目點擊右鍵 點擊 Properties 選擇Deployment Assembly 再點擊右邊的Add按鈕 選擇Java Build Path Entries後點擊Next按鈕 然後選擇你的Maven Dependencies 確定即可。