[size=large]如图
[img]http://dl.iteye.com/upload/attachment/549288/e0f8fe1b-f8bb-3cff-91be-44ab831d6227.jpg[/img]
这是在myeclipse的web项目下的src文件夹下 在jQueryLoader中我想引用文件jsFile.xml改如何写
我使用File f = new File("..\jsFile.xml");报错为找不到文件[/size]
[code="java"]
InputStream inputStream = jQueryLoader.class.getResourceAsStream("/jsFile.xml");[/code]
File f = new File("./jsFile.xml");是这样吧!
[quote]File f = new File("..\jsFile.xml");[/quote]
改为
[code="java"]File f = new File("src/jsFile.xml");[/code]
或者
[code="java"]File f = new File("/src/jsFile.xml");[/code]
到底是哪个忘了,但肯定有一个是行的,你试试目的地