Reputation: 47290
org.springframework.stereotype;
or
org.springframework.web.servlet.mvc;
I had been using the stereotype but just noticed I have another option ?
Upvotes: 0
Views: 205
Reputation: 5537
org.springframework.stereotype.Controller
Is an annotation. It indicates that the annotated class is a controller as well as a candidate for auto-detection (like a @Component). This is the annotation you want to use.
org.springframework.web.servlet.mvc.Controller
Is an interface for implementing controllers. In most simple cases you probably don't want to be using this.
Upvotes: 3