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.
精彩评论