Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- ajax
- Android
- curl
- SeLinux
- CentOS
- Spring
- MySQL
- Linux
- html
- 톰캣
- 와일드카드
- NetBeans
- 리눅스
- javascript
- 안드로이드
- input
- php
- error
- DB
- 이클립스
- laravel
- JSON
- tomcat
- java
- properties
- 정규식
- junit
- jquery
- larravel
- File
Archives
- Today
- Total
합쭈기 programming
소스상에서 properties 사용하기 본문
@Component
@PropertySource("classpath:/props/global.properties")
public class PropsManager {
@Autowired
Environment env;
public String getLocalPath()
{
return env.getProperty(PropsParam.LOCAL_PATH);
}
public String getImagePath()
{
return env.getProperty(PropsParam.LOCAL_PATH) + env.getProperty(PropsParam.IMAGE_PATH);
}
public String getBoardPath()
{
return env.getProperty(PropsParam.BOARD_PATH);
}
static class PropsParam{
static final String LOCAL_PATH = "localPath";
static final String IMAGE_PATH = "imgPath";
static final String BOARD_PATH = "boardPath";
}
}
'Java > Spring' 카테고리의 다른 글
| xml에서 properties 설정 사용하기 (0) | 2015.05.11 |
|---|---|
| JRebel - 재구동 없이 java & xml 변경 plugin (0) | 2015.05.11 |
| out of memory 체크 (0) | 2015.05.06 |
| filter에서 bean 사용하기 (0) | 2015.04.27 |
| request parameter를 서버단에서 추가하기 (0) | 2015.04.27 |