久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

如何通過相對路徑引用本地 XSD 文件

How to Reference Local XSD File By Relative Path(如何通過相對路徑引用本地 XSD 文件)
本文介紹了如何通過相對路徑引用本地 XSD 文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

這是 如何配置 Eclipse 以使用的后續內容`ehcache` 并且在 如何正確引用本地 XML Schema 文件?

由于不再托管 xsd 文件,我從存檔中下載了它的副本.我已將該文件放在我的資源目錄中,并希望在我的 xsi:schemaLocation 中從我的項目的相對路徑中引用它.我們有 windows 和 mac 開發人員,所以像 file:///c:/project/foo 這樣的絕對路徑約定是行不通的.

Since the xsd file is not longer being hosted, I downloaded a copy of it from the archive. I've put the file in my resource directory and would like to reference it in my xsi:schemaLocation from a relative path of my project. We have both windows and mac developers, so an absolute path convention like file:///c:/project/foo won't work.

相對路徑的另一種替代方法是,如果有一種方法可以引用 windows 和 mac 的系統屬性,那么我可以執行 2 個條目,例如 file:///$HOME/workspace/foo.

Another alternative to relative path would be if there is a way to reference system properties for both windows and mac, then I could do 2 entries like file:///$HOME/workspace/foo.

我的 Mac 上的項目存在于 ~/workspace/foo 中,$HOME 的 echo 給出了我的主路徑.

My project on my mac exists in ~/workspace/foo and echo of $HOME gives my home path.

我的spring-cache.xml存在于./src/main/webapp/WEB-INF/spring/

我的 ehcache-spring-1.2.xsd 存在于 ./src/main/resources/

以下是我嘗試過但沒有成功的一些:

The following are some that I've tried without success:

        file:///$HOME/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
        file:///./src/main/resources/ehcache-spring-1.2.xsd             
        file:///../../../../resources/ehcache-spring-1.2.xsd
        file:///../../../../resources/ehcache-spring-1.2.xsd
        ../../../../resources/ehcache-spring-1.2.xsd
        file://../../../../resources/ehcache-spring-1.2.xsd
        file://$HOME/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
        file://./src/main/resources/ehcache-spring-1.2.xsd              
        file://../../../../resources/ehcache-spring-1.2.xsd

我似乎也有問題讓它從絕對路徑引用文件,所以也許有不同的方式來引用 mac 上的文件?例如以下方法無效:

I also seem to have issues getting it to reference the file from absolute path too, so perhaps there is a different way to reference the file on mac? e.g. The following did not work:

file:///Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file:////Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd
file://Users/me/workspace/foo/src/main/resources/ehcache-spring-1.2.xsd

推薦答案

認為我的問題是 webapp 目錄可能無法查看資源文件夾.

Think my issue was that the webapp dir may not have visibility to the resources folder.

我這樣說是因為基于對以下堆棧溢出問題的閱讀,看起來相對路徑的東西應該非常直截了當:帶有 XML Schema 本地副本的 XML 文件 和 如何在 XML 文檔中使用本地機器上的 Schema

I say this because based on the reading of the following stack overflow questions, it looks like the relative path stuff should be pretty straigh forward: XML File with local copy of XML Schema and How to use Schema that is on local machine in XML document

然后我嘗試暴力破解引用,以防它與部署目錄或類路徑有關,并且以下所有操作都失敗了:

I then tried to brute force the references, in case it was something with deploy directory or class path, and all of the following failed:

../../../../resources/ehcache-spring-1.2.xsd
../../../resources/ehcache-spring-1.2.xsd
../../resources/ehcache-spring-1.2.xsd
../resources/ehcache-spring-1.2.xsd
./resources/ehcache-spring-1.2.xsd
../ehcache-spring-1.2.xsd
./ehcache-spring-1.2.xsd

解決辦法:

但是,通過將 xsd 文件從 ./src/main/resources/ 移動到 ./src/main/webapp/WEB-INF/spring/ 我當時只需 ehcache-spring-1.2.xsd

However by moving the xsd file from ./src/main/resources/ to ./src/main/webapp/WEB-INF/spring/ I was then able to reference it correctly/easily by just ehcache-spring-1.2.xsd

這篇關于如何通過相對路徑引用本地 XSD 文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to wrap text around components in a JTextPane?(如何在 JTextPane 中的組件周圍環繞文本?)
MyBatis, how to get the auto generated key of an insert? [MySql](MyBatis,如何獲取插入的自動生成密鑰?[MySql])
Inserting to Oracle Nested Table in Java(在 Java 中插入 Oracle 嵌套表)
Java: How to insert CLOB into oracle database(Java:如何將 CLOB 插入 oracle 數據庫)
Why does Spring-data-jdbc not save my Car object?(為什么 Spring-data-jdbc 不保存我的 Car 對象?)
Use threading to process file chunk by chunk(使用線程逐塊處理文件)
主站蜘蛛池模板: 日韩欧美国产精品一区二区三区 | 亚洲一二三区精品 | 高清国产午夜精品久久久久久 | 2018天天干天天操 | 成人免费视频网站在线看 | 欧美在线观看一区 | 午夜视频在线免费观看 | 黄网站色大毛片 | 在线观看久草 | 一级毛片免费 | 国产精品综合久久 | 亚洲综合在线视频 | 日本特黄特色aaa大片免费 | 亚洲成人免费视频在线观看 | 亚洲成人免费视频在线 | 亚洲精品一区二区三区中文字幕 | 亚洲欧美一区二区三区国产精品 | 国产精品1区2区 | 国产成人高清视频 | 久久88| 中文在线一区二区 | 99热欧美 | 天天干夜夜操 | 日韩成人精品 | 日韩视频一区二区 | 日韩一级在线 | 国产精品久久久久久久久久久免费看 | 日韩精品久久一区二区三区 | 天天天操 | 福利网址| 国产精品不卡视频 | 亚洲欧美中文日韩在线 | 影音先锋男 | 成人午夜免费福利视频 | 精品国产精品三级精品av网址 | 日屁视频 | 欧美一级在线观看 | 中文字幕国产精品 | av中文字幕网站 | 欧美 中文字幕 | 久久草在线视频 |