나의 마음을 ctrl+c,너의 가슴에 ctrl+v

Spring3 properites call

설정

<util:properties id="globals" location="classpath:/egrovframework/egovProps/globals.properties"/>

<!-- Messages .properties Path -->
<util:list id="configMessages" list-class="java.util.LinkedList">

   <value>egovframework.message.com.message-common</value>

   <!-- 
   <value>egovframework.message.com.validation</value>            <value>egovframework.message.com.javascript</value>
    -->

</util:list>


호출 - xml

<property name="maxUploadSize">
    <value>#{globals['File.maxUploadSize']}</value>
</property>


호출 - java

@Value("#{globals['Server.charset']}")
private String charset;

@Value("#{prop['global.arrs'].split(',')}") private String arr; // split 처리

// Bean 으로 생성되었으므로, Autowired 가능
@Autowired Properties globals;


호출 - jsp

<spring:eval expression="@config['']" />


'java > framework' 카테고리의 다른 글

jsp 에서 Spring framework 연동  (0) 2013.07.19
Spring Controller intercepter By 3.0 , annotation  (0) 2012.07.06