Skip to content

Instantly share code, notes, and snippets.

@shamalroy
Last active August 29, 2015 14:11
Show Gist options
  • Save shamalroy/0b1a2ef18ee9db82e125 to your computer and use it in GitHub Desktop.
Save shamalroy/0b1a2ef18ee9db82e125 to your computer and use it in GitHub Desktop.
AEM (Adobe CQ) XSSAPI example in JSP
<%@ include file="/libs/foundation/global.jsp" %>
<%
String siteTitle = request.getParameter("siteTitle");
String websiteLink = request.getParameter("websiteLink");
%>
<html>
<head>
<title>
<%= xssAPI.encodeForHTML(siteTitle); %>
</title>
</head>
<body>
<a href="<%= xssAPI.getValidHref(websiteLink); %>">Website Link</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment