[opencms-dev] cms.include not working for xmlpages

Tim Clark tclark at efoundry.com
Tue Feb 20 01:48:42 CET 2007


Hi all.

 

I'm running into some confusion about the way CMS includes work.

 

I have a JSP file in the templates folder of my module that needs to do a
cms include using request parameters.

 

There are two scenarios I have to get working with this technique. One's
working, the other's not.

 

Scenario 1: 

CmsJspActionElement cms = new
CmsJspActionElement(pageContext,request,response);

cms.include("ads.jsp", "ad1"); 

 

.where "ads.jsp" is a template living in the same template folder as the JSP
file trying to load from it, and "ad1" is an element within "ads.jsp". This
works fine - the proper ad is returned.

 

Scenario 2:

CmsJspActionElement cms = new
CmsJspActionElement(pageContext,request,response);

cms.include("/sites/default/index.jsp", "main");

 

.where "/sites/default/index.jsp" is an xmlpage with elements to be included
by the template, "main" being the element to load in this case. This does
not work - a blank page is returned as if the page could not be found. 

 

I assumed that this would be the same as doing a <cms:include
property="main" /> in the template assigned to "/sites/default/index.jsp".
Is my assumption correct? If not, what's the Java API equivalent to get the
same result?

 

Anything you know of that could point me in the right direction would be
pretty helpful. Thanks in advance .

 

- Timothy M. Clark



 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20070219/042e10fc/attachment.htm>


More information about the opencms-dev mailing list