You could write a ServletContextListener:
public class MyServletContextListener implements ServletContextListener
{
public void contextInitializedImpl(ServletContextEvent event)
{
ServletContext servletContext = event.getServletContext();
String contextpath = servletContext.getRealPath("/");
// Provide the path to your backend software that needs it
}
//...
}
and configure it in web.xml
<listener>
<listener-class>my.package.MyServletContextListener</listener-class>
</listener>