1、打開eclipse的window-preferences,搜索catalog。
2、點擊add,點擊File System,彈出頁面選擇spring-beans-4.2.xsd。
3、key type 選擇schema location。
在key的后方加上斜杠/及約束的名字。
4、點擊ok。下一個頁面繼續點擊OK。
5、新建applicationContext.xml。輸入<beans></beans>。
6、點擊applicationContext.xml下方的design。右鍵beans,單擊edit namespace。
7、點擊add,先導入xsi。
8、點擊add,導入約束
9、點擊source,回到配置頁面,按alt+/,發現已經可以提示了。至此spring約束導入成功,可以在離線模式下進行使用。