Expand my Community achievements bar.

How to integrate an existing jsp - servlet website with adobe experience manager?

Avatar

Level 2

I have an existing jsp servlet website developed using - jsp, struts,  tiles, spring mvc, hibernate. currently deployed in tomcat and using postgresql database. Is it possible to integrate this website with adobe AEM website? How? need some instruction. Thanks

4 Replies

Avatar

Level 4

The only tool that AEM has that lets you import an existing web site is named site importer:

https://docs.adobe.com/docs/en/aem/6-1/develop/dev-tools/site-importer.html

However - the backend stuff like SPring MVC will not be imported. Actually - Spring MVC does not really work with AEM as AEM is based on Sling and OSGi container.  You do not setup controllers like Spring uses. 

Instead of using Hibernate - you may want to look at using DataSourcePools and configure the databases on AEM configuration.

You will need to download the driver file and wrap it into an OSGI driver file: 

https://jdbc.postgresql.org/download.html

See this article on how to use DataSourcePool and wrap a driver file: https://helpx.adobe.com/experience-manager/using/datasourcepool.html.

Once you do this - you can use Java wihtin an AEM service to interact with your database, 

So your back end logic will need to be ported to OSGi bundles and using the given APIs supported by AEM.  

Your Spring MVC Servlets will need to be ported to Sling Java Servlets too. 

Hope this helps... 

Avatar

Level 2

Thanks Steve, I get your point. But I do not want to port my code to aem as it is huge. Is it possible to create a site in AEM and then inside that AEM site showing the existing website? If so how? some instruction will be very helpful. (There is a old fashion I know, using iFrame. Is there any way like that in AEM, something more better)

NOTE: You may ask why I need to do so - it is our client requirement. They already have their site using AEM. and want us to integrate our site with them.

Avatar

Level 10

As Steve points out - you need to use the site importer tool to import HTML pages.

But your Spring Java code, etc - it will need to be ported to AEM. I have some projects aside from AEM that use Spring MVC and controller code, etc - so i know both Sling/OSGi and Spring MVC, autowire, controller classes, etc very well. 

You will need to port the Java - unfortunately - with AEM - Java code runs in OSGi bundles and use Sling annotations.

Spring and Sling use different annotations too - Spring uses @autowire and SLing uses @Refernce to inject classes. THat is only 1 difference - but the point i am making is you cannpt simply take a Spring based site and inject it into AEM. You will need to do porting of Java code from Spring classes to OSGi bundles.

One option you have is to contact Adobe consulting  - they can help you port the site too. 

By the way, that will make a good Ask the Experts session sometime. How to port a Spring based site to AEM

Avatar

Employee Advisor

Hi,

so you want your old site appear in-line in AEM (and hopefully avoiding the iframe)? One solution I can think of are serverside includes on webserver level; your AEM components render the proper SSI statements so the webserver can fetch the pages from the old site.

Jörg