[opencms-dev] Class CmsRequestHttpServlet

Alexander Kandzior alex at opencms.org
Tue Mar 25 11:43:36 CET 2003


Laurent,

if the JSP is outside of OpenCms then there is currently no easy way to
create an instance of the CmsObject that I know of. 

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com



> -----Original Message-----
> From: owner-opencms-dev at www.opencms.org 
> [mailto:owner-opencms-dev at www.opencms.org] On Behalf Of Laurent Vernet
> Sent: Tuesday, March 25, 2003 10:35 AM
> To: opencms-dev at www.opencms.org
> Subject: RE: [opencms-dev] Class CmsRequestHttpServlet
> 
> 
> Hello,
> 
> In this sample code you assume that my JSP is contained in a 
> module ? isn't it ?
> 
> I just want to make a simple JSP page in an other WEBAPP (i 
> think it might be in the same WEBAPP) accessing OpenCms with 
> the API. Thus, i think i have to initialize a new CmsObject 
> and then call the desired method on it. As the documentation 
> says, the 'CmsObject' is the access point to the CmsResource, 
> isn't it ?
> 
> I think i have to initialize an 'A_OpenCms' (OpenCms) and 
> then call the
> openCms.initUser(...) method,
> to initialize the CmsObject.
> 
> I think something is 'maybe' missing in my understanding.
> 
> I am waiting for your feedbacks.
> 
> Thanks a lot.
> 
> Laurent.
> 
> 
> 
> -----Message d'origine-----
> De : owner-opencms-dev at www.opencms.org 
> [mailto:owner-opencms-dev at www.opencms.org]De la part de 
> Alexander Kandzior Envoye : vendredi 21 mars 2003 14:51 A : 
> opencms-dev at www.opencms.org Objet : RE: [opencms-dev] Class 
> CmsRequestHttpServlet
> 
> 
> Laurent,
> 
> you can not create a new instance of the CmsObject on a JSP 
> page, use this code instead:
> 
> <%
> com.opencms.flex.jsp.CmsJspActionElement cms =
>      new 
> com.opencms.flex.jsp.CmsJspActionElement(pageContext, request,
> response);
> com.opencms.file.CmsObject cmsObject = cms.getCmsObject();
> %>
> 
> Best Regards,
> Alex.
> 
> Alexander Kandzior
> Alkacon Software - The OpenCms Experts
> http://www.alkacon.com
> 
> > -----Original Message-----
> > From: owner-opencms-dev at www.opencms.org 
> > [mailto:owner-opencms-dev at www.opencms.org] On Behalf Of 
> Laurent Vernet
> > Sent: Friday, March 21, 2003 2:39 PM
> > To: opencms
> > Subject: [opencms-dev] Class CmsRequestHttpServlet
> >
> >
> > Hi All,
> >
> > How to retrieve/construct a CmsRequestHttpServlet object to 
> initialize 
> > the CmsObject by the call of :
> >
> > ...
> > CmsObject cmsObject = new CmsObject();
> > OpenCms oCms = cms.initUser(cmsObject,cmsRequest,
> > cmsResponse, userName, groupName, projectId, cmsSession );
> >
> > in a jsp page.
> >
> > We can't build a 'CmsRequestHttpServlet' because there's no public 
> > constructor, but we can build a CmsExportRequest object.
> >
> > 2 solutions :
> >
> > 1) Make the 'CmsRequestHttpServlet' constructor public (it 
> is 'private 
> > package' at the moment).
> >
> > 2) Add a factory to retrieve a 'CmsRequestHttpServlet' with a 
> > 'HttpServletRequest'.
> >
> >
> > Is there any code sample to initialize the CmsObject in a jsp page.
> >
> > Regards,
> >
> > Laurent Vernet
> > 148 Rue Anatole France
> > 92688 Levallois-Perret Cedex
> > T: +33 1 55 63 18 17
> > E: laurent.vernet at fr.adp.com
> >
> >
> >
> >
> >
> 




More information about the opencms-dev mailing list