헤르메스 LIFE

[전자정부프레임워크] EgovPropertyServiceImpl 본문

Spring Framework

[전자정부프레임워크] EgovPropertyServiceImpl

헤르메스의날개 2020. 11. 12. 23:26
728x90

context-properties.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd">

	<bean name="propertiesService"
		class="egovframework.rte.fdl.property.impl.EgovPropertyServiceImpl"
		destroy-method="destroy">
		<property name="properties">
			<map>
				<entry key="currentPageNo" value="1" />
				<entry key="recordCountPerPage" value="30" />
				<entry key="pageSize" value="10" />
				<entry key="urlSuffix" value=".do" />
			</map>
		</property>
	</bean>
</beans>	

 

@Controller 에서 사용의 예

    @Resource( name = "propertiesService" ) 
    EgovPropertyService propertiesService;
    
    .
    .
    .
    
    logger.debug( "propertyService.currentPageNo :: {}", propertiesService.getString( "currentPageNo" ) );

 

@Resource를 사용해서 사용할 수 있습니다.

"context-properties.xml"에서 설정된 "propertiesService" 라는 이름으로 무조건 사용해야 합니다.

 

 

728x90