title: How to convert spring bean integration From XML to Java annotation based Config
body: <p>I have this xml based configuration. But in my project I want to use java annotation based configuration. How to do the conversion?</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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.xsd"&gt;
  
      &lt;bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"&gt;
          &lt;property name="host" value="mail.csonth.gov.uk"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="registrationService" class="com.foo.SimpleRegistrationService"&gt;
          &lt;property name="mailSender" ref="mailSender"/&gt;
          &lt;property name="velocityEngine" ref="velocityEngine"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="velocityEngine" class="org.springframework.ui.velocity.VelocityEngineFactoryBean"&gt;
          &lt;property name="velocityProperties"&gt;
              &lt;value&gt;
                  resource.loader=class
                  class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
              &lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>