title: How to get the project base path in Spring mvc web application?
body: <p>I have spring mvc web application which is deployed on a tomcat server. On that project, I want to create folders and files in the runtime. currently I can create folders in the server root by using <code>System.getProperty("catalina.base")</code>. But when I deployed the project in a externel server I cant create folders on the root level of the tomcat server beacuse I don't have permissions. Intead of that I decided to create folders in following directory.</p>
  
  <pre><code>tomcat_dirctory/webapps/myproject_directory
  </code></pre>
  
  <p>so I need to create folders and files in side the <code>myproject_directory</code> in the runtime. Can anyone tell me what is the path for that. May be I can hardocde that as follows.</p>
  
  <pre><code> System.getProperty("catalina.base") + File.separator + "webapps"+File.separator+"myproject_directory"
  </code></pre>
  
  <p>But Instead of hard coding I prefer to know is there any alternative way to obtain  my project path.</p>