You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by FaRHaN <fa...@ymail.com> on 2009/08/19 14:11:29 UTC

How to get Project Folder's Relative Path ?

I want to get relative path of my current wicket project folder. I have used System.getProperty("user.dir") method but it returns the path of Tomcat's bin directory.  
I want to access files of my project through relative path, so that i can access these files on other System also. I have my project in the following directory: C:\projects\sampleProject, I have also tried using ServletContext but it returns the build directory of my project, i.e. 
WebApplication.get().getServletContext().context.getRealPath("/"); // returns C:\projects\sampleProject\build\web
WebApplication.get().getServletContext().context.getContextPath(); // returns /sampleProject

But i want only the project folder (C:\projects\sampleProject).
Is there a way to get relative path of my proejct ?

Thanks...