Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Sling Doubt

Avatar

Level 3

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

Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Level 6

@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

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

@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