Where should I put the .jar file so that I can import it in my JSP? | Community
Skip to main content
gu_hamilton
Level 2
October 16, 2015
Solved

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

  • October 16, 2015
  • 3 replies
  • 955 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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.

3 replies

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

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.

Lokesh_Shivalingaiah
Level 10
October 16, 2015

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. 

gu_hamilton
Level 2
October 16, 2015

Ah, that's great, thank you.

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