???????????????????Java??????????????????????????Servlet??Spring???????Structs??????????????????????Java???????????????????(resource)????????????????????????????Щ??????????Class?????????ClassLoader??

???????????????????????????????????????xml?????properties????????????????????????

??????1??????????????÷???????

??????2???????????????????????

???????????Java?????????????????????????????????ж??????

????????????????????????????????????classpath?????????????jar?У?????jar???????classpath???檔

??????????????????????????????????Class????ClassLoader????????????????????????????????????Class???ClassLoader????????????????????

???????????Class???????????

???????????Class???getResourceAsStream??????????????????

????public InputStream getResourceAsStream(String pathToConfigFile)??

?????÷??????????String??????????pathToConfigFile?????????????????????????????????????????????????(InputStream)?????????????null???????????????pathToConfigFile???????????????????????????λ???????pathToConfigFile??"/"????????Java??classpath?????????????pathToConfigFile??????????????????????????λ???????pathToConfigFile????"/"?????????????????·????????????getResourceAsStream?????????package·??????pathToConfigFile???????package???????"."???"/"??

??????????????IntelliJ Idea?д??????java????????????£?

?????ù???????????resources????У????λ??davenkin??????£???????λ??src?????????????resources????????????config.properties??????????????

name = ConfigUnderDavenkin

?????????resources?????????????config.properties??????????????

name = ConfigUnderSrc