daily pastebin goal
88%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Loading properties file from WEB-INF folder in a log4j appender
  2. InputStream stream = Thread.currentThread().getContextClassLoader()
  3.                     .getResourceAsStream("jdbc.properties");
  4.    
  5. String  path =Thread.currentThread().getContextClassLoader().getResource("/").toURI().resolve("../jdbc.properties").getPath();
  6.  Properties ps=new Properties();
  7.  ps.load(new FileInputStream(path));
  8.    
  9. ServletContext ctx = ...
  10. InputStream stream = ctx.getResourceAsStream("/WEB-INF/jdbc.properties");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top