Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Nível 1
Nível 2
Faça login na Comunidade
Faça logon para exibir todas as medalhas
Esta conversa foi bloqueada devido à inatividade. Crie uma nova publicação.
Hi Team,
I tried the below code in sling models but I got error for declaring adapters -
@Model(adaptables = Resource.class, adapters = MyModel.class)
public class MySlingModel {
}
I'm using the below dependencies -
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.models.api</artifactId>
<version>1.1.0</version>
<scope>provided</scope>
</dependency>
Earlier I used for the version 1.0.0. But it is not working. I'm unable to use adapters.
Can you pls help me in this?
Thanks,
AryA.
Solucionado! Ir para a Solução.
Visualizações
respostas
Total de curtidas
You have used @Model incorrectly.
There is no way to create a Sling Model from more than one adaptable, Your class can adapt to multiple means it can adapt to different classes but at one point of time only one.
Read more about How to use Sling Model with Sightly in AEM
regards,
Ankur Ahlawat
Visualizações
respostas
Total de curtidas
What version of AEM are you using?
Visualizações
respostas
Total de curtidas
We are going to release a new AEM 6.2 SLing Model Article. I will post soon.
Visualizações
respostas
Total de curtidas
Hi
Please refer to :- https://helpx.adobe.com/experience-manager/using/sling_models.html
//
Adding following dependency to the pom.xml help overcoming this problem:
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-atinject_1.0_spec</artifactId>
<version>1.0</version> <scope>provided</scope>
</dependency>
Reference :- Go to depfinder:- http://localhost:4502/system/console/depfinder [to find out dependency]
Please let me know, what exactly is the error coming?
PS:- Please add the dependency mentioned. Even the article Link mentioned by me is missing with this dependency, so add it and run it.
Thanks and Regards
Kautuk Sahni
Visualizações
respostas
Total de curtidas
smacdonald2008 wrote...
We are going to release a new AEM 6.2 SLing Model Article. I will post soon.
Article Released:- https://helpx.adobe.com/experience-manager/using/slingmodel_62.html
~kautuk
Visualizações
respostas
Total de curtidas
You have used @Model incorrectly.
There is no way to create a Sling Model from more than one adaptable, Your class can adapt to multiple means it can adapt to different classes but at one point of time only one.
Read more about How to use Sling Model with Sightly in AEM
regards,
Ankur Ahlawat
Visualizações
respostas
Total de curtidas
Visualizações
Curtida
respostas
Visualizações
Curtida
respostas