I'm using servlet 2.3 for my project development due to some legacy code we have. Is there a way to get the context path in the init method or any other way of the servlet?
I know it's possible on higher versions of Servlet and can get it in hacky way using the getRealPath()
method on servlet 2.3. However I'm still looking for a better and cleaner code.