I am using Tomcat. I would like to put the config file in WEB-INF instead of the default root class path which is WEB-INF/classes. Currently I put
WEB-INF
WEB-INF/classes
You can use getServletConfig() method return an instance of ServletConfig.
ServletContext sc=getServletConfig().getServletContext();
EDIT:
public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException, ServletException{ ServletContext sc=getServletContext(); ... }