Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaÅäÖÃÎļþ¶ÁÈ¡

JavaÅäÖÃÎļþ¶ÁÈ¡Óи÷ÖÖ²»Í¬µÄÎļþ£¬µ«ÊÇÓÉÓÚ´ò°üJarºóµÄ·¾¶¸Ä±ä£¬ÍùÍùÔÚÏîÄ¿ÖÐÄÜÕýÈ·¶ÁÈ¡µÄÅäÖÃÎļþÔÚJarºó±ä³ÉÎļþ²»´æÔڵı­¾ß£¬ÏÂÔÚÌá³ö¼¸¸÷²»Í¬µÄÅäÖÃÎļþ¶ÁÈ¡·½Ê½£¬½ö¹©²Î¿¼
Ò»¡¢Ö±½ÓÎļþ¶ÁÈ¡
File f = new File("you config file path");
FileReader fr = new FileReader(f);
BufferReader br = new BufferReader(fr);
String str = br.readLine();
String para = null;
while(str != null){
//here to get the parameter in the line by key
String para = getPara(key);
return para ;
}

ÕâÖÖ·½Ê½µÄºÃ´¦ÊÇÅäÖÃÎļþ¿ÉÒÔ×Ô¼ºÏëÒªµÄ·½Ê½´æÔÚ£¬ÈçiniÎļþ£¬Èçkey = value£¬»òkey:valueµÈ£¬Ö»Òª×Ô¼ºÄܽâÊÍ¡£
µ«£¬ÓÉÓÚ·¾¶µÄÎÊÌ⣬ºÍ¶ÁȡȨÏÞ£¬ÍùÍùÍùÍùÔÚÏîÄ¿ÖÐÄÜÕýÈ·¶ÁÈ¡µÄÅäÖÃÎļþÔÚJarºó±ä³ÉÎļþ²»´æÔڵı­¾ß
¶þ¡¢²ÉÓÃProperties
DataInputStream dis = ClassLoader.getResourceAsStream("your config file path");
Properties p = new Properties() ;
p.load(dis );
//here get the para value by key
getResource(key) ;
ÕâÖÖ·½·¨¼õÉÙÁËÒ»ÖÐȡÿ¸öÊôÐÔ´øÀ´ºÍ·±ÔÓ¹ý³Ì£¬µ«ÒÀÈ»ÎÞ·¨½â¾ö·¾¶±ä»¯µÄÎÊÌâ
Èý¡¢×Ô¶¯Ñ°ÕÒ£¬×Ô¶¯¶ÁÈ¡
ResourceBundle rb = ResourceBundle.getBundle("your config file name");
//get value of key
rb.getString(key);

ÕâÖÖ·½Ê½×Ô¶¯Ñ°ÕÒÅäÖÃÎļþ£¬×Ô¶¯¶ÁÈ¡ÊôÐÔ
Èý¡¢beanģʽ
1.ÀûÓÃClassPathXmlApplicationContext
ApplicationContext context = new ClassPathXmlApplicationContext("beanConfig.xml");HelloBean helloBean = (HelloBean)context.getBean("helloBean");System.out.println(helloBean.getHelloWorld());
2.ÀûÓÃFileSystemResource¶ÁÈ¡
Resource rs = new FileSystemResource("D:/software/tomcat/webapps/springWebDemo/WEB-INF/classes/beanConfig.xml"); BeanFactory factory = new XmlBeanFactory(rs); HelloBean helloBean = (HelloBean)factory.getBean("helloBean"); System.out.println(helloBean.getHelloWorld());


Ïà¹ØÎĵµ£º

Cavaj Java Decompiler ·´±àÒëÆ÷

Cavaj Java Decompiler is a graphical freeware utility that reconstructs Java source code from CLASS files. You can decompile Java applets, JAR and ZIP files, producing accurate Java source code. Browse the reconstructed source code with the Class View for instant access to methods and fields. The pr ......

Java¼ÓÃܼ¼Êõ£¨Æߣ©£¨1£© ¶¹¶¹Íø

¶¹¶¹Íø   ¼¼ÊõÓ¦ÓÃƵµÀ   2009Äê06ÔÂ10ÈÕ  ¡¾×ֺţºÐ¡ÖÐ´ó¡¿ Êղر¾ÎÄ
JProfiler memcached JavaCC EclEmma Jester Java¼ÓÃܼ¼Êõ£¨Æߣ©¡£
¡¡¡¡ECC
¡¡¡¡ECC-Elliptic Curves Cryptography£¬ÍÖÔ²ÇúÏßÃÜÂë±àÂëѧ£¬ÊÇÄ¿Ç°ÒÑÖªµÄ¹«Ô¿ÌåÖÆÖУ¬¶Ôÿ±ÈÌØËùÌṩ¼ÓÃÜÇ¿¶È×î¸ßµÄÒ»ÖÖÌåÖÆ¡£ÔÚÈí¼þ×¢²á ......

¼ÌÐø Âþ̸Java¼ÓÃܼ¼Êõ£¨Ò»£©

  HMAC
    HMAC£¨Hash Message Authentication Code£¬É¢ÁÐÏûÏ¢¼ø±ðÂ룬»ùÓÚÃÜÔ¿µÄHashËã·¨µÄÈÏ֤ЭÒé¡£ÏûÏ¢¼ø±ðÂëʵÏÖ¼ø±ðµÄÔ­ÀíÊÇ£¬Óù«¿ªº¯ÊýºÍÃÜÔ¿²úÉúÒ»¸ö¹Ì¶¨³¤¶ÈµÄÖµ×÷ΪÈÏÖ¤±êʶ£¬ÓÃÕâ¸ö±êʶ¼ø±ðÏûÏ¢µÄÍêÕûÐÔ¡£Ê¹ÓÃÒ»¸öÃÜÔ¿Éú³ÉÒ»¸ö¹Ì¶¨´óСµÄСÊý¾Ý¿é£¬¼´MAC£¬²¢½«Æä¼ÓÈëµ½ÏûÏ¢ÖУ¬È»ºó´«Êä¡ ......

ʹÓà Java Éú³É MD5 ±àÂë

MD5¼´Message-Digest Algorithm 5£¨ÐÅÏ¢-ÕªÒªËã·¨5£©£¬ÊÇÒ»ÖÖÓÃÓÚ²úÉúÊý×ÖÇ©ÃûµÄµ¥ÏîÉ¢ÁÐËã·¨£¬ÔÚ1991ÄêÓÉMIT Laboratory for Computer Science£¨IT¼ÆËã»ú¿ÆѧʵÑéÊÒ£©ºÍRSA Data Security Inc£¨RSAÊý¾Ý°²È«¹«Ë¾£©µÄRonald L. Rivest½ÌÊÚ¿ª·¢³öÀ´£¬¾­ÓÉMD2¡¢MD3ºÍMD4·¢Õ¹¶øÀ´¡£MD5Ëã·¨µÄʹÓò»ÐèÒªÖ§¸¶ÈκΰæȨ·ÑÓá£ËüµÄ×÷ ......

java·´ÉäÖ®´´½¨ÊµÀý

  ΪÁË×öµ½Ê¹µÃ³ÌÐò¾ßÓиü¸ßµÄÁé»îÐÔ£¬¿ÉÅäÖÃÐÔ£¬ÔÚ¿ª·¢ÖÐÎÒÃǾ­³£ÀûÓ÷´ÉäÀ´´´½¨Ò»¸öÀàµÄʵÀý£¬Ò²¾ÍÊÇ»ñµÃÒ»¸öÀàµÄÒ»¸ö¶ÔÏó£¡Í¨³£µÄ×ö·¨ÊÇͨ¹ýclass.newInstance»ñµÃ£»µ«ÕâÖÖ·½·¨ÓÐÒ»¸ö²»ºÃµÄµØ·½£¬ÄǾÍÊÇËûÖ»ÄÜ´´½¨Î޲ι¹ÔìÆ÷µÄ¶ÔÏó£¬Èç¹û¹¹ÔìÆ÷ÓвÎÊýÄÇËüÊÇÎÞÄÜΪÁ¦µÄ£»½â¾öµÄ·½·¨¾ÍÊÇ ÏÈͨ¹ý¸ÃÀàµÄClass»ñµÃ´øÓвΠ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ