STRUTS2 상수설정
프로그래밍/JAVA |
2008. 3. 28. 10:33
상수는 프레임워크의 작동 방식에 대한 환경 설정 요소입니다.
default.properties
이 파일은 struts2-core-버전.jar 파일의 org.apache.struts2 패키지에 존재하며 모든 환경 설정 기본값이 설정 되어 있습니다. 따라서 설정 파일들을 통해 설정을 변경 하고자 하는 프로퍼티만 변경 하면 됩니다.
설정 항목들에 대해서는 이 파일을 참조하면 됩니다.
struts.properties 에서 설정
이 파일은 default.properties 와 설정 방법이 동일하며 ClassPath 루트에 위치해야 합니다.
struts.xml 에서 설정
web.xml 에서 설정
여러 파일에서 환경 설정을 할 수 있듯이 Struts2가 환경 설정 값을 찾는 순서도 있습니다.
나중에 찾는 설정중에 이전의 중복된 설정이 있다면 나중에 찾는 설정이 오버라이드 됩니다.
struts-default.xml -> struts-plugin.xml -> struts.xml -> struts.properties -> web.xml
출처 : http://jjaeko.tistory.com/50
default.properties
이 파일은 struts2-core-버전.jar 파일의 org.apache.struts2 패키지에 존재하며 모든 환경 설정 기본값이 설정 되어 있습니다. 따라서 설정 파일들을 통해 설정을 변경 하고자 하는 프로퍼티만 변경 하면 됩니다.
설정 항목들에 대해서는 이 파일을 참조하면 됩니다.
struts.properties 에서 설정
이 파일은 default.properties 와 설정 방법이 동일하며 ClassPath 루트에 위치해야 합니다.
struts.xml 에서 설정
<struts>
<constant name="프로퍼티명" value="프로퍼티값" />
......
</struts>
<constant name="프로퍼티명" value="프로퍼티값" />
......
</struts>
web.xml 에서 설정
<web-app ......>
<filter>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<init-param>
<param-name>프로퍼티명</param-name>
<param-value>프로퍼티값</param-value>
</init-param>
</web-app>
<filter>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<init-param>
<param-name>프로퍼티명</param-name>
<param-value>프로퍼티값</param-value>
</init-param>
</web-app>
여러 파일에서 환경 설정을 할 수 있듯이 Struts2가 환경 설정 값을 찾는 순서도 있습니다.
나중에 찾는 설정중에 이전의 중복된 설정이 있다면 나중에 찾는 설정이 오버라이드 됩니다.
struts-default.xml -> struts-plugin.xml -> struts.xml -> struts.properties -> web.xml
출처 : http://jjaeko.tistory.com/50
'프로그래밍 > JAVA' 카테고리의 다른 글
STRUTS2 + AJAX 한글깨짐방지 (0) | 2008.09.09 |
---|---|
STRUTS2 Action Class에서 request, response 객체 얻어오기 (0) | 2008.04.04 |
STRUTS2 필수 라이브러리 (0) | 2008.03.28 |
JSP 한글처리 (0) | 2008.03.24 |
JSP 캐쉬비우기 - 항상 새로운 내용 가져오는 설정 (0) | 2008.03.20 |