Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

The Spring series, Part 1: Introduction to the Spring framework

A first look at Spring AOP and the IOC container

Return to article

When you print this page, select the landscape layout option.


Listing 7. The config file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" 
         "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>

<bean id="createCreditCard" -->define createCreditCard definition
class="springexample.creditcardaccount.CreateCreditCardAccount">
<property name="creditRatingInterface">-->inject creditRatingInterface dependency  via creditRating reference bean
<ref bean="creditRating" />
</property>
<property name="creditLinkingInterface">">-->inject creditLinkingInterface dependency  via creditLinking reference bean
<ref bean="creditLinking" />
</property>
<property name="emailInterface">">">-->inject emailInterface dependency  via email reference bean
<ref bean="email" />
/property>
</bean>

<bean id="creditLinking" class="springexample.creditlinking.CreditLinking">
<property name="url">
<value>http://localhost/creditLinkService</value>-->set url property value 
</property>
</bean>

<bean id="creditRating" class="springexample.creditrating.CreditRating">
</bean>

<bean id="email" class="springexample.email.Email">
<property name="smtpHost">
<value>localhost</value>>-->set smpHtpHost property value 
</property>
<property name="fromEmail">
<value>mycompanyadmin@mycompanyadmin.com</value>
</property>
<property name="userId">
<value>myuserid</value>
</property>
<property name="password">
<value>mypassword</value>
</property>
</bean>
</beans>

Return to article.