title: How do we get the absolute path to the applications root directory using Spring?
body: <p>I have an app that may run at <a href="http://serverA/m/" rel="nofollow">http://serverA/m/</a> or <a href="http://serverA/mobile/" rel="nofollow">http://serverA/mobile/</a>. I have a shared  header with a search form that needs to go to <a href="http://serverA/" rel="nofollow">http://serverA/</a><em>installationName</em>/search.</p>
  
  <p>However, if I use <code>&lt;form action="/search"&gt;</code> it goes to the root of the server, not the tomcat application.</p>
  
  <p>If I use <code>&lt;form action="search"&gt;</code> it goes to a path relative to the current page. (i.e <a href="http://serverA/m/someOtherPage/search" rel="nofollow">http://serverA/m/someOtherPage/search</a></p>
  
  <p>I've tried <code>&lt;c:url value="search"&gt;</code> and <code>&lt;c:url value="/search"&gt;</code> but neither of them seem to work.</p>
  
  <p>In intelliJ, <code>&lt;c:url value="/search"&gt;</code> gives me "Cannot resolve controller URL /search" even though I have a controller defined with @RequestMapping("/search")</p>