| Prefix | Example | Explanation |
|---|---|---|
| classpath: | classpath:com/myapp/config.xml | Loaded from the classpath. |
| file: | file:/data/config.xml | Loaded as a URL, from the filesystem. [1] |
| http: | http://myserver/logo.png | Loaded as a URL. |
| (none) | /data/config.xml | Depends on the underlying ApplicationContext. |
classpath* vs. classpath
classpath只會找package下第一個找到的
classpath*會找到所有的符合條件的 包含jar檔內
一般情況下沒必要用classpath*
沒有留言:
張貼留言