Expand my Community achievements bar.

SOLVED

How to create tagfile based JSP custom tags in content packages?

Avatar

Level 7

There is this article (god, why do all CQ blogs have horrible 90's-esque looks?) about how to include tag files (.tag custom tags) within a CQ bundle module. However IntelliJ has trouble providing content assist/parsing/code completion when the tag files are created in the content bundle.

Can someone explain (or show me an article) what needs to be done in order to bundle tag files within content packages?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Bundling JSP tag library files within content packages in Adobe Experience Manager (AEM) can be achieved by following these general steps:

  1. Create the JSP Tag Library: First, you need to create the JSP tag library that contains your custom tags. These tags could be used for various functionalities in your AEM application.

  2. Create a Java Bundle: To bundle the JSP tag library within a content package, you'll need to create an OSGi bundle (Java bundle) that includes the JSP tag library files.

  3. Include the Bundle in the Content Package: Once you have the Java bundle containing the tag library, you need to include it in your AEM content package.

  4. Define Filters: To ensure that only the necessary files are included in the content package, define content package filters to specify which files and resources should be included.

  5. Package Metadata: Add appropriate package metadata properties to provide descriptive information about your content package.

  6. Build and Install the Content Package: After setting up the content package, build it, and then install it on your AEM instance. This will make the custom tags and their related resources available within your AEM application.

However, in 2023, tab libs are pretty much obsolete, and currently we utilize backend Sling Models, OSGI Services, and Utils. 

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Bundling JSP tag library files within content packages in Adobe Experience Manager (AEM) can be achieved by following these general steps:

  1. Create the JSP Tag Library: First, you need to create the JSP tag library that contains your custom tags. These tags could be used for various functionalities in your AEM application.

  2. Create a Java Bundle: To bundle the JSP tag library within a content package, you'll need to create an OSGi bundle (Java bundle) that includes the JSP tag library files.

  3. Include the Bundle in the Content Package: Once you have the Java bundle containing the tag library, you need to include it in your AEM content package.

  4. Define Filters: To ensure that only the necessary files are included in the content package, define content package filters to specify which files and resources should be included.

  5. Package Metadata: Add appropriate package metadata properties to provide descriptive information about your content package.

  6. Build and Install the Content Package: After setting up the content package, build it, and then install it on your AEM instance. This will make the custom tags and their related resources available within your AEM application.

However, in 2023, tab libs are pretty much obsolete, and currently we utilize backend Sling Models, OSGI Services, and Utils.