I am attempting to run a Java web project under Tomcat 8 that traditionally runs under WebSphere. One servlet makes the following call:
xslFilePath = config.getServletContext().getRealPath(System.getProperty("file.separator") + "xsl");
config is an instance of ServletConfig.
The xsl is inside the project and deployed as C:\myproject\build\web\xsl. When the servlet attempts to reference a file located in xslFilePath, I get an exception which indicates that Tomcat is actually looking for the xsl file in C:\Program Files\Apache Software Foundation\Apache Tomcat 8.0.3\bin\null. Obviously this is the wrong location, and nothing is found.
Unfortunately I can't change the code because I don't have access to the source. So I would like to know if this is the expected behavior for Tomcat? Is there any Tomcat configuration that will let me ensure the path is referenced to the deployment directory and not to the Tomcat bin directory? Would choosing some other servlet container be preferable? Any advice would be appreciated.