關於SpringMVC中找不到標籤的解決辦法

在項目中經常遇到eclipse一直加載

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">

這三個文件,主要原因是編輯器中的schema過於陳舊。導致找不到<mvc:resources/>標籤。

在springMVC中我們經常會用到<mvc:resources/>標籤。

以下是我解決這個問題的一個方法,寫出來供參考:

打開window->preferences,在輸入框輸入xml找到xml Catalog。在右邊中找到http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd

這一項並單擊,看下面的Details,找到文件路徑和key。

key:http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd

那麼我們打開網址:http://www.springframework.org/schema/mvc並下載spring-mvc-3.0.xsd文件。

再打開文件路徑:Location: D:\MyEclipse-8.6\configuration\org.eclipse.osgi\bundles\1077\1\.cp\org\springframework\web\servlet\config\spring-mvc-3.0.xsd

找到文件:D:\MyEclipse-8.6\configuration\org.eclipse.osgi\bundles\1077\1\.cp\org\springframework\web\servlet\config下面。

用下載的文件進行替換即可。最後重啓myeclipse即可。


如果在window->preferences的xml Catalog中沒有找到對應的文件,那麼我們直接打開網址:http://www.springframework.org/schema/mvc並下載spring-mvc-3.0.xsd文件。

然後點擊xml Catalog面板上的add按鈕,把下載的文件放進去就OK啦,然後重啓eclipse即可。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章