write and read file on web service (axis2 + tomcat 7)

最后都变了- 提交于 2019-12-11 11:29:29

问题


I'm writing a service for Axis2 + Tomcat7.0 with Java for the application. I've chosen to write any information to xml file, the problem is where is the root of the service/application server?

I read the other question but isn't response good.

How can I get an absolute path to the writable directory by the service?


回答1:


I would set an environment variable and then read the value of it by using System.getProperty().

I think the default file writing location is wherever you are when you start the server, at least that's what I found with JBoss one time. The easiest thing is to either set an environment variable in a server property file, or create a property file for your service to use to retrieve the location. I've done it both ways with JBoss in windows and unix.



来源:https://stackoverflow.com/questions/8918329/write-and-read-file-on-web-service-axis2-tomcat-7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!