[opencms-dev] using cms:include from a jsp

eelboy at aol.com eelboy at aol.com
Sun Nov 28 16:49:46 CET 2010


Hi, 
 
I keep getting a Null Exception Pointer (at org.opencms.xml.CmsXmlUtils.createXpath(CmsXmlUtils.java:145) when trying to include a structured content type into a jsp. Here is my VFS layout: 
 
/sites/mysite/index.jsp  (<-- has cms:include file=/_include/_hpSlides/slide-test-1.jsp) 
/sites/mysite/_include/_hpSlides/slide-test-1.jsp (<-- Type is hp-slide-default) 
/system/modules/com.mysite/schemas/hp-slide-default.xsd 
/system/modules/com.mysite/templates/HP-Slide-Default.jsp (<-- this is the value for property template-elements on _include_ folder) 
 
So basically, if I navigate in the workplace directly to /sites/mysite/_include/_hpSlides/slide-test-1.jsp I see my content render just as I want it: with the template controlling all the surrounding markup, and the structured content elements being pulled in via the cms:include tags (referencing the specific elements) within the template. 
 
Now I would like to include that same rendered markup inside of another jsp page.  In this case, I want my index.jsp to simply include the slide-test-1.jsp so that the exact same markup I saw when I previewed the slide-test-1.jsp simply appears inside the index.jsp where the cms:include is.  Instead I get the always dreaded NullExceptionPointer....  I feel like I am just not understanding something very basic about how OpenCms works (I am a complete newbie of course!)   I am using version 7.5.3.   I hope I've provided enough information if not let me know and I can provide plenty more :) 
 
I should point out that I can of course use a cms:include from within index.jsp and then pull in specific elements (exactly the same way as the template code does) but this defeats the purpose (for me anyways) as I would like to abstract the entire block of that section in the index page so that perhaps some other day a different cms:include will pull in a completely different block of markup from a different structured content type.  Does this make sense? 
 
Thanks, 
eelboy 
 

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20101128/818ea9ef/attachment.htm>


More information about the opencms-dev mailing list