Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

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