java应用程序获取Web工程下的配置文件

  1. WebContext wctx = WebContextFactory.get();   
  2. String FILE_NAME = wctx.getServletContext().getRealPath("/")+"/WEB-INF/dbconfig.txt";   
  3.   
  4. //通过DWR中的WebContext来获取上下文路径  

你可能感兴趣的:(java,Web,DWR)