title: Spring not calling setters
body: <p>I have following configuration
  web.xml:</p>
  
  <pre><code>    &lt;!DOCTYPE web-app PUBLIC
   "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
   "http://java.sun.com/dtd/web-app_2_3.dtd" &gt;
  
  
  
  &lt;web-app&gt;
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;minapp&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;minapp&lt;/servlet-name&gt;
      &lt;url-pattern&gt;hello.htm&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
     &lt;servlet&gt;
      &lt;servlet-name&gt;register&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
    &lt;/servlet&gt;
  
    &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;register&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/register/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
    &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;
        index.jsp
      &lt;/welcome-file&gt;
    &lt;/welcome-file-list&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>applicationContext.xml:</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"
      xmlns:p="http://www.springframework.org/schema/p"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"&gt;
  
      &lt;bean id="myDataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
  
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/minapp" /&gt;
          &lt;property name="username" value="root" /&gt;
          &lt;property name="password" value="verysecret" /&gt;
      &lt;/bean&gt;
  
  
      &lt;bean id="myUserDAO" class="no.java.UserDAOImpl"&gt;
          &lt;property name="DataSource" ref="myDataSource"/&gt;
      &lt;/bean&gt;
  
      &lt;bean name="/register/register.htm" class="no.java.RegistrationController" &gt;
          &lt;property name="UserDAO" ref="myUserDAO" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>setter for RegistrationController</p>
  
  <pre><code>private UserDAO userDAO;
  
  public void setUserDAO(UserDAO userDAO) {
      System.out.println("dao set");
      if (userDAO == null){
  
          System.out.println("dao null");
      }
      this.userDAO = userDAO;
  }
  </code></pre>
  
  <p>setter for UserDAOImpl:</p>
  
  <pre><code>private DataSource dataSource;
  
      public void setDataSource(DataSource source){
          System.out.println("data source setter called");
          this.dataSource=source;
  
      }
  </code></pre>
  
  <p>And neither the RegistrationController setter nor the UserDAOImpl setter are called.
  I have a feeling that i might have misplaced the configuration, but due to the complexity of Spring documentation i cant get what i have done wrong.
  as far as i understand the contextConfigLocation should point spring to the applicationContext.xml , and that file should do some magic in order to setup the database connection, but it does not.
  I'd be very grateful for any help.</p>