Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Niveau 1
Niveau 2
Se connecter à la communauté
Connectez-vous pour voir tous les badges
Cette conversation a été verrouillée en raison de son inactivité. Veuillez créer une nouvelle publication.
Any ideal use-case of injecting servlet in Sling Models ? @Model(adaptables=SlingHttpServletRequest.class)public class MyModel {@Inject@Filter("(paths=/bin/something)")private List<Servlet> servlets;}
Ref. :-https://sling.apache.org/documentation/bundles/models.html
Résolu ! Accéder à la solution.
Vues
Réponses
Nombre de J’aime
According to the docs - you can use this annotation to filter OSGi injections "OSGi injection can be filtered"
However - i am not finding use cases or examples with Sling Models that make use of this feature.
Here is another code example of SLing Models (-but it does not use @Filter)
Vues
Réponses
Nombre de J’aime
What's your point?. Why would you use servlet in SlindModel?.
Jitendra
Vues
Réponses
Nombre de J’aime
Yes, reason being calling servlet methods do not makes much sense.
May be I am missing something here in case of servlet.
Injecting any other service seems reasonable though.
Vues
Réponses
Nombre de J’aime
By design, Servlets are not mean to be treated like services. Servlet technology is being used for communication between client & server over the HTTP protocol.
Sunil Chowdhary wrote...
Yes,
reason being calling servlet methodsdo not makes much sense.
May be I am missing something here in case of servlet.
Injecting any other service seems
reasonable though .
Vues
Réponses
Nombre de J’aime
Here is a related article on using Sling Models within AEM:
https://helpx.adobe.com/experience-manager/using/sling_models.html
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
Thanks for your reply.
Went through the mentioned article, but still not able to get the use of below code available at
https://sling.apache.org/documentation/bundles/models.html
@Inject@Filter("(paths=/bin/something)")private List<Servlet> servlets;
Vues
Réponses
Nombre de J’aime
According to the docs - you can use this annotation to filter OSGi injections "OSGi injection can be filtered"
However - i am not finding use cases or examples with Sling Models that make use of this feature.
Here is another code example of SLing Models (-but it does not use @Filter)
Vues
Réponses
Nombre de J’aime
Vues
Likes
Réponses
Vues
Likes
Réponses