Using this method
getServletContext().getRealPath("/")
returns '\' at the end when i run my project in Tomcat 7 whereas it is not working as such in Tomcat 8.
For example,
In Tomcat 7 it returns as "D:\Tomcat\webapps\project\"
In Tomcat 8 it returns as "D:\Tomcat\webapps\project"
At present the project is in production so, I am unable to change the code in every part(where i use getRealPath("/")
). Is there a way/setting in tomcat level to make it resolved.
This issue has been Fixed in trunk for 9.0.x and in 8.0.x for 8.0.19 onwards.
For your reference,