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.

AEM 6.5.12.0 - Sling Models Use Pojos Anti Samy Rules for Custom Tags | AEM Community Blog Seeding

Avatar

Administrator

BlogImage.jpg

AEM 6.5.12.0 - Sling Models Use Pojos Anti Samy Rules for Custom Tags by Sreekanth Choudry Nalabotu

Abstract

Goal
When adding Custom Tags via Sling Models or Use Pojos, without overlaying the Anti Samy rules and add the tags in /apps/cq/xssprotection/config.xml, you should see the following in error.log...

Solution
1) Create the Pojo /apps/eaem-anti-samy-model/components/basic-render-component/ExperienceAEMModel.java

package apps.eaem_anti_samy_model.components.basic_render_component;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.PostConstruct;

public class ExperienceAEMModel {
private static final Logger log = LoggerFactory.getLogger(ExperienceAEMModel.class);

public String getHtml() {
return "" +
"CREF Board of Trustees" +
"
The CREF Board of Trustees consists of 10 people who oversee the management of CREF.
" +
"";
}
}


2) Create the component render script /apps/eaem-anti-samy-model/components/basic-render-component/basic-render-component.html

Experience AEM Basic Render Component


${eaemModel.html @ context='html'}

3) Overlay the AntiSamy config file /apps/cq/xssprotection/config.xml and add the following....





....

......


















Read Full Blog

AEM 6.5.12.0 - Sling Models Use Pojos Anti Samy Rules for Custom Tags

Q&A

Please use this thread to ask the related questions.



Kautuk Sahni
0 Replies