XSD 文件本地加载
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                XSD 文件本地加载
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                ??在 JavaEE 工程中,會使用 XML 配置文件,XML 配置文件在解析時會加載 XSD 文件,但是 XSD 文件通常是在國外網站上的,經常會出現因為網絡等原因造成的 XSD 文件加載不進來的問題,這時可以采用本地加載的形式。
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0"><display-name>JavaWeb1</display-name><welcome-file-list><welcome-file>index.html</welcome-file><welcome-file>index.htm</welcome-file><welcome-file>index.jsp</welcome-file><welcome-file>default.html</welcome-file><welcome-file>default.htm</welcome-file><welcome-file>default.jsp</welcome-file></welcome-file-list>??第一步:下載 xsd 文件
??打開http://xmlns.jcp.org/xml/ns/javaee網站,從中找到需要下載的 xsd 文件,我這里需要下載的是 web-app_4_0.xsd 文件。
 ??將下載后的文件找一個位置放好,推薦將 xsd 文件專門放到一起。
??第二步:配置 Eclipse
??Window → Preferences → XML → XML Catalog → 選中 User Specified Entries → Add → 填好信息 → OK → Apply And Close
 
??配置完成之后,使用方法還是和以前一樣,不需要修改 web.xml 文件,但是加載的時候優先從本地加載。
總結
以上是生活随笔為你收集整理的XSD 文件本地加载的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: SQL依据条件插入
- 下一篇: android性能测试工具之dumpsy
