In my servlet:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
new Action();
}
In my Action class:
Action(){
System.out.println("--> " + this.getClass().getResource("/").toString());
}
I have on result, this location:
--> file:/C:/Users/saad/Desktop/apache-tomcat-7.0.37/wtpwebapps/Serveur/WEB-INF/classes/
But i would like to get access to the root of my webApp like this:
file:/C:/Users/saad/Desktop/apache-tomcat-7.0.37/wtpwebapps/Serveur/
I insist that the Action class does not inherit from the HttpServlet, so i can't use ServletContext.getResource("") .
How can i do this ?