0 0

something about configuring ibatis.30

Hi,
Actually my iBatis xml config files are under the classpath so, to include an xml file in the main configuration file (that is under WEB-INF/iBatis folder) I usually write:
<sqlMap resource="it/mypakage/Example.xml" />
(and it works)

I need to move all my files under WEB-INF/iBatis directory of my web application.
I read iBatis manual and tried with the "url" attribute, like this:
<sqlMap url="file:///c:/myProject/www/WEB-INF/iBatis/Example.xml" />
and it works!

Now I want to make the path relative to the project (and not absolute to my hard drive c: like in the above example).
I tried with ;
<sqlMap url="file:///WEB-INF/iBatis/Example.xml" /> and
<sqlMap url="file:///Example.xml" /> and
<sqlMap url="file:Example.xml" /> and
and a million of other ways, but it doesn't work

What is the correct way to use a relative path with the url attribute?
2009年2月27日 15:46

2个答案 按时间排序 按投票排序

0 0

采纳的答案

<sqlMap url="file:///WEB-INF/iBatis/Example.xml" /> and
<sqlMap url="file:///Example.xml" /> and
<sqlMap url="file:Example.xml" /> and

都是错误的

url 必须跟一个有效的绝对地址

2009年2月27日 15:53
0 0

relative url path ,u can use "~/","../"+x.xml

2009年2月27日 16:12

相关推荐

Global site tag (gtag.js) - Google Analytics