/*************************************** * *********************************** To obtain the specified properties * @ Param propertiesname * file name * @ Param paramname * property name * @ return paramvalue returns the corresponding property value ************ **************************************** * ********************/Public String getpropert (string propertiesname, string paramname) {inputstream in = This. getclass (). getclassloader (). getresourceasstream (propertiesname); properties prop = new properties (); string paramvalue = NULL; try {prop. load (in); paramvalue = prop. getproperty (paramname ). trim ();} catch (ioexception e) {e. printstacktrace ();} finally {try {In. close ();} catch (ioexception e) {e. printstacktrace () ;}} return paramvalue ;}
This. getclass (). getclassloader (). getresourceasstream (""); is the default WEB-INF \ Classes directory after the SRC root directory is published