[opencms-dev] Including opencms content in an external webapplication

Jason Trump jason.trump at brulant.com
Thu Feb 16 23:38:48 CET 2006


Hi Petros,

We've done something like this to display OpenCms content in a WebLogic Portal application.  I'd recommend just deploying the opencms WAR on the same application server, and then using simple servlet RequestDispatcher includes to load and display the content.  This strategy is much easier than trying to make API calls to load the content, because OpenCms itself makes heavy use of the servlet/JSP container to render the content.  Loading the documents from the database is unlikely to give you something very useful.

Something like this in your servlet code:


public void loadCmsContent(ServletContext myContext, HttpServletRequest request, HttpServletResponse response, String cmsPath)
{
     ServletContext opencmsContext = myContext.getContext("/opencms");
     RequestDispatcher dispatcher = opencmsContext.getRequestDispatcher("/opencms" + cmsPath);
     dispatcher.include(request, response);
}


I found that I also had to create a special subclass of HttpServletRequestWrapper to pass to RequestDispatcher.include to make this work correctly, as well as a subclass of HttpServletResponseWrapper to capture the results (as I did not want to immediately include the cms document in the current response).  You can send me an email directly if you want to discuss this approach in more detail.

Hope that helps,
jason

-----Original Message-----
From: opencms-dev-bounces at opencms.org on behalf of Petros Giakouvakis
Sent: Fri 2/17/2006 1:20 AM
To: opencms-dev at opencms.org
Subject: [opencms-dev] Including opencms content in an external webapplication
 
Hi,

I am trying to include content written in opencms to be included in an 
external web application. Can anybody tell which jars are needed for 
this and how this is done exactly?

I have searched through the archive, but haven't really found an answer 
to this.
Kind regards,
Petros

_______________________________________________
This mail is sent to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://lists.opencms.org/mailman/listinfo/opencms-dev

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3838 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060216/c3e6a027/attachment.bin>


More information about the opencms-dev mailing list