Sling Doubt | Community
Skip to main content
Level 3
October 16, 2015
Solved

Sling Doubt

  • October 16, 2015
  • 1 reply
  • 753 views

We mark the servlet with @Component and @Service what is the difference between the two annotations?

Thanks in advance!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sam205505050

@Component annotation declares your java class as a component but @Service annotation declares which service interface will be refereed by component

More details : http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annotations.html

1 reply

Sam205505050Accepted solution
Level 6
October 16, 2015

@Component annotation declares your java class as a component but @Service annotation declares which service interface will be refereed by component

More details : http://felix.apache.org/documentation/subprojects/apache-felix-maven-scr-plugin/scr-annotations.html