简体   繁体   中英

File Path issue in Java Axis2 WebService

I'm developing a web service using axis2 & tomcat . There I use a data.xml file to store some information. When I give the Absolute Path for the data.xml file, everything works fine. But I am looking for a way to give the file path in relative to the source file. To achive that I have tried several methods.

(the deployed aar file is located under C:/tomcat/webapps/axis2/WEB-INF/service.aar )

This is my folder structure.

+Project
|-src
|-data
  |-data.xml
  1. I have added the data folder to the build path.
  2. I have tried to include the file as ./data/data.xml

But it failed. Can anyone suggest me a best/recommended way to do this?

-Regards

After a long research, I found that it is impossible to do it. It should be a absolute path for the xml file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM