Custom Tag Libs for Adobe CQ

Follow the below steps for creating custom Tab libraries: Step 1: Write a java Class with the method  you want as a tag lib. I’m providing an example java class here: /** * */ package; import javax.servlet.jsp.JspException; import javax.servlet.jsp.JspWriter; import javax.servlet.jsp.tagext.DynamicAttributes; import javax.servlet.jsp.tagext.TagSupport; /** * @author rmengji * */ public class ReusableTagLibs extends TagSupport […]

Creating an OSGI bundle from jar

Step 1: Start by creating jar’s manifest file: “manifest.txt” Manifest-Version: 1.0 Created-By: yourname Bundle-ManifestVersion: 2 Bundle-Name:  Junit 4.4 bundle Bundle-Description: Package junit 4.4 is an OSGI bundle Bundle-Version: 4.4.0 Bundle-ClassPath: .,junit-4.4.jar Bundle-SymbolicName: org.junit.framework Export-Package: * Bundle-ClassPath header is set to allow embedding the original jar as is. Make sure its value matches the filename of […]

Error Handlers that render different HTTP errors

The default error handler scripts are located under “/libs/sling/servlet/errorhandler”. You can overlay default error handling by copying the script you would like to customize from “libs/sling/servlet/errorhandler” to the same location under “/apps”  (i.e. /apps/sling/servlet/errorhandler). Create this path if it does not exist (it doesn’t by default). For example you can customize the handing of 404 […]

Adobe CQ : Creating Custom Namespaces

Adobe CQ uses namespaces to maintain modularity between the properties and also tags.  namespaces help in distinguishing different modules of the project. We create thousand of properties in our project and many times it consists of just words. Hence to make the properties names meaningful we can add a namespace to project related namespaces. Note […]