-
-
Save david-hosier/734cc8680902358eded9 to your computer and use it in GitHub Desktop.
Custom Tag in CQ
This file contains 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
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<taglib xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd" version="2.1"> | |
<tlib-version>1.0</tlib-version> | |
<short-name>aauwww</short-name> | |
<uri>http://foo.bar/aau/taglib</uri> | |
<tag> | |
<name>testAndTargetEnabled</name> | |
<tag-class>net.ftlines.wcm.aau.taglib.TestAndTargetEnabledTag</tag-class> | |
<body-content>JSP</body-content> | |
</tag> | |
</taglib> |
This file contains 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
Caused by: java.lang.NoSuchMethodError: net.ftlines.wcm.aau.taglib.TestAndTargetEnabledTag.setJspContext(Ljavax/servlet/jsp/JspContext;)V | |
at org.apache.jsp.apps.aauwww.components.page.page.body_jsp._jspx_meth_aauwww_005ftestAndTargetEnabled_005f0(body_jsp.java:250) | |
at org.apache.jsp.apps.aauwww.components.page.page.body_jsp._jspService(body_jsp.java:185) | |
at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) | |
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) | |
at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502) |
This file contains 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
package net.ftlines.wcm.aau.taglib; | |
import javax.servlet.jsp.JspException; | |
import javax.servlet.jsp.tagext.TagSupport; | |
import net.ftlines.util.PropertyUtils; | |
public class TestAndTargetEnabledTag extends TagSupport { | |
@Override | |
public int doStartTag() throws JspException { | |
if (PropertyUtils.isTestAndTargetEnabled()) { | |
return EVAL_BODY_INCLUDE; | |
} | |
return SKIP_BODY; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment