title: Does a Spring annotated controller necessarily need a default constructor
body: <p>I have a spring controller that uses annotations. I gave this controller a constructor that takes two arguments. I want both ways of initializing the controller: constructor injection and setter injection.</p>
  
  <pre><code>@Controller("viewQuestionController")
  @RequestMapping("/public/viewQuestions")
  public class ViewQuestionController
  {
      @Resource(name="questionService")
      private QuestionService questionService;
  
     /*public ViewQuestionController()
   {
      int i=0;
      i++;
   } 
     */   
  
  public ViewQuestionController(@Qualifier("questionService") QuestionService questionService)
  {
      this.questionService = questionService;
  }
  
  @Resource(name="questionService")
  public void setQuestionService(QuestionService questionService)
  {
      this.questionService = questionService;
  }
  }   
  </code></pre>
  
  <p>When I uncomment the default constructor, the controller is initiated correctly. However, if I don't, I get a BeanInstantiationException,  No default constructor found; nested exception is java.lang.NoSuchMethodException.
  So, is my configuration for the annotated constructor wrong or does a completely annotated controller in spring always need a default constructor?</p>