[opencms-dev] OpenCms and Spring MVC - Is the Integration worth it?

Marc Fasel marc.fasel at shinetech.com
Tue Jul 17 07:28:23 CEST 2012


Ludwig Hunecke <ludwig.hunecke <at> hushmail.com> writes:

> 
> Hi Marc,
> 
> Spring MVC is hosted in a separate standalone web application (in our case
> also on a different application server). The integration of Spring MVC into
> OpenCms is basically done via AJAX. This means:
> OpenCms (i.e. a formatter JSP) makes a $.ajax(...) jQuery call to load the
> initial view of the Spring MVC application. The result is stored into a DIV
> inside the OpenCms web page. Now the integration of an external Spring
> application into the OpenCms based web page is basically already done. The
> navigation inside the Spring MVC application is now done exclusively via
> AJAX. This means, inside the Spring application you cannot use normal links
> (otherwise you would leave the OpenCms web page). All navigation is done via
> AJAX requests. In our case each AJAX request delivers a HTML snippet, which
> is simple placed into the current page.
> 
> In order to call back from Spring MVC to OpenCms, we implemented Apache CXF
> based JAX-RS (REST) webservices in OpenCms. The services provide basic
> functions in order to CRUD contents.
Hi Ludwig,

thanks for your reply. The standalone application is the cleaner solution,
but I find the Alax calls and the web service communication quite complex 
for the problem at hand.
 
We will try to include SpringMVC into OpenCMS application context, even 
though it requires manually modifying the OpenCMS web.xml to 
included the dispatcher servlet. That's not pretty, but I think everything 
else will be pretty standard. We are looking at a rewrite filter (like 
Mathias sample project) to link the OpenCMS resource to a Spring MVC 
controller method that creates a model. Then we want to create a 
custom view resolver to map a symbolic view name to an actual OpenCMS 
resource. I am hoping that this is all the integration we need.

I'll post the results of our integration soon.

Cheers

Marc  




More information about the opencms-dev mailing list