SpringFramework_1004

Last modified by superadmin on 2018-01-12 20:19

Back to Item Set

<p/>
<!-- START TestItem -->
<p/>
<div class="TestItem">
<div class="TestItemQuestion">1004 Question:\

Select a correct way to use properties from external file in Spring configuration file.

</div>

Select 1 correct answer(s)!

<p/>
<ol class="MTestItemChoices" type='A'>
<li>

{code}
<bean class="org.springframework.beans.factory.config.ExternalPropertyConfigurer">
  <property name="locations" value="classpath:/local.properties"/>
</bean>

<bean id="myService" class="lv.lu.MyService">
  <property name="secretKey" value="${local.secretKey}"/>  
</bean>
{code}

</li>
<li>

{code}
<bean class="org.springframework.beans.factory.config. ExternalPropertyConfigurer ">
  <property name="file" value="classpath:/local.properties"/>
</bean>

<bean id="myService" class="lv.lu.MyService">
  <property name="secretKey" value="#{local.secretKey}"/>  
</bean>
{code}

</li>
<li>

{code}
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
  <property name="locations" value="classpath:/local.properties"/>
</bean>

<bean id="myService" class="lv.lu.MyService">
  <property name="secretKey" value="${local.secretKey}"/>  
</bean>
{code}

</li>
<li>

{code}
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer ">
  <property name="file" value="classpath:/local.properties"/>
</bean>

<bean id="myService" class="lv.lu.MyService">
  <property name="secretKey" value="#{local.secretKey}"/>  
</bean>
{code}

</li>
</ol>
<p/>
<div class="TestItemSkill"><!--$skillid>Skill: $skilltitle</div>
<p/>
</div>
<!-- END MTestItem -->
<p/>
<p/>


{{/velocity}}

Tags:
Created by Alina Vasiljeva on 2012-12-29 18:39
    
This wiki is licensed under a Creative Commons 2.0 license
XWiki Enterprise 6.4 - Documentation