开发者

Retrieve Local Tomcat Path for File Access

Is there a way to retrieve the Tomcat local GWT directory in order to save a file?

In order to retrieve a file it's

new File(getClass().getResource(nam开发者_开发百科eOfAFile).getPath());

Therefore how would I retrieve path of the tomcat host in order to save a file 'hello.xml'?


In tomcat, you can use ServletContext.getRealPath() to get the path for a file in your webapp then you can do navigate to "../" to find tomcat dir.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜