Does ServletContext.getRealPath() work with web fragments?
问题 I use web fragments (servlet 3 spec) and thus can load e.g. META-INF/resources/access.xml file which is in a library in /WEB-INF/lib/ of my WAR via ServletContext.getResourceAsStream("access.xml") . Doing the same with ServletContext.getRealPath("access.xml") doesn't work (=> null ). The spec states: The getRealPath method takes a String argument and returns a String representation of a file on the local file system to which a path corresponds. Resources inside the META-INF/resources