user.dir is incorrect while using tomcat web app in eclipse

I have a configuration project that few projects are using it.
All of my project under the same workingspace.

workingspace/configuration

workingspace/webapp1

workingspace/mongoDB

workingspace/model

mongoDB and the model project are using the configuration jar project and able to read the xml files using relative path ../configuration/conf/….xml

when using the

 System.out.println("Working Directory = " +
                          System.getProperty("user.dir"));

inside both of them, I’m getting the correct path (workspace)

while trying to do it from the web app servlet i’m getting the folder of eclipse.exe that causing some problems.

How can i fix the user.dir defalte path for the web app?


Source: eclipse

Leave a Reply