Expand my Community achievements bar.

SOLVED

Where should I put the .jar file so that I can import it in my JSP?

Avatar

Level 2

Hi All,

A simple question for AEM new learner...

I write a java class and wrap it into a .jar file, but, in AEM (or CQ), where should I put (or other action) this .jar file, so that I can import/reference it in my own JSP?

1 Accepted Solution

Avatar

Correct answer by
Level 10

In AEM, you wrap all Java (you own classes, and JARs) into OSGi bundles. We have many articles showing you how to do this. See:

Creating your first AEM Service using an Adobe Maven Archetype project (this shows you how to create a basic OSGi that contains a service that you invoke from a JSP)

Submitting Adobe CQ form data to custom Sling Servlets (this shows you how to create a SLing Servlet, and wrap a 3rd party JAR that is a dependency into a bundle fragment)

See the AEM Community page for a lot more community how to articles. 

Also - as a newer AEM user - be sure to read Adobe Experience Manager Onboarding resources.

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

In AEM, you wrap all Java (you own classes, and JARs) into OSGi bundles. We have many articles showing you how to do this. See:

Creating your first AEM Service using an Adobe Maven Archetype project (this shows you how to create a basic OSGi that contains a service that you invoke from a JSP)

Submitting Adobe CQ form data to custom Sling Servlets (this shows you how to create a SLing Servlet, and wrap a 3rd party JAR that is a dependency into a bundle fragment)

See the AEM Community page for a lot more community how to articles. 

Also - as a newer AEM user - be sure to read Adobe Experience Manager Onboarding resources.

Avatar

Level 10

You should bundle all your classes into OSGi bundle and install the same on your AEM instance. Once that bundle is installed, you can access the same in your JSP file. 

Avatar

Level 2

Ah, that's great, thank you.

Seems I need to learn the Apache Maven and OSGI bundle first.