i want to get the inputstream to configuration file lying under webinf folder in tomcat in java ?i want the configuration file as inputstream lying under web-inf folder in tomcat in java . I tried below code
InputStream xwikicfgis = FIPSSOAuthServiceImpl.class.getClassLoader().getResourceAsStream("config.cfg");
but its trying to search the file under web-inf/classes folder but my file lies directly under web-inf folder. i am not getting how to point the path to web-inf instead of web-inf/classes folder?
You can get it using servletConfig.getServletContext().getResourceAsStream(“/WEB-INF/filename”) from any servlet.