Last active
November 10, 2017 23:31
-
-
Save shamalroy/ed75659bbeefb79a34c5 to your computer and use it in GitHub Desktop.
AEM (Adobe CQ) XSSAPI usage example in Java class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.adobe.granite.xss.XSSAPI; | |
import org.apache.sling.api.resource.ResourceResolver; | |
public class UserComment { | |
public String getFilteredComment(ResourceResolver resourceResolver, String commentTxt) { | |
XSSAPI xssAPI = resourceResolver.adaptTo(XSSAPI.Class); | |
return xssAPI.getValidHref(commentTxt); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment