05 2012 档案

读取工程中的配置文件
摘要:1. 读取web工程下的资源文件方式一 获得绝对路径String realpath = ServletContext.getRealPath("相对web应用的路径") ;方式二 获得与文件相关联的流 (2.1与2.2是一样的)2.1 InputStream in = ServletContext.getResourceAsStream("WEB-INF/classes/config.properties") ;2.2 URL url = ServletContext.getResource("WEB-INF/classes/config.pr 阅读全文

posted @ 2012-05-03 22:05 Knuth_档案 阅读(417) 评论(0) 推荐(0) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示