How to find a relative path to the configuration file

xiaoxiao2021-03-06  84

Simple example in this week's project

Profile can be placed in the class sessate directory under Web-INF

Properties var = new profment ();

ClassLoader ClassLoader =

Thread.currentthread (). GetContextClassLoader ();

Try {

Var.Load (ClassLoader.getResourceAsStream (configfile);

} catch (ioexception e) {

// Todo Auto-Generated Catch Block

E.PrintStackTrace ();

}

转载请注明原文地址:https://www.9cbs.com/read-108113.html

New Post(0)