title: multiple packages in context:component-scan, spring config
body: <p>How can I add multiple packages in spring-servlet.xml file in <code>context:component-scan</code> element?</p>
  
  <p>I have tried</p>
  
  <pre><code>&lt;context:component-scan base-package="z.y.z.service" base-package="x.y.z.controller" /&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;context:component-scan base-package="x.y.z.service, x.y.z.controller" /&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;context:component-scan base-package="x.y.z.service" /&gt;
  &lt;context:component-scan base-package="x.y.z.controller" /&gt;
  </code></pre>
  
  <p>but got error:</p>
  
  <pre><code>org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [x.y.z.dao.daoservice.LoginDAO] found for dependency:
  </code></pre>