[opencms-dev] Displaying the content
Jonathan Woods
jonathan.woods at scintillance.com
Wed Sep 27 12:11:20 CEST 2006
Jodi -
The value you use for __element presumably depends on which element it is
whose content you want to display.
Jon
_____
From: Jordi Marquès [mailto:jordi.marques at gmail.com]
Sent: 27 September 2006 10:50
To: Jonathan Woods
Cc: 'Jordi Marquès'; 'The OpenCms mailing list'
Subject: RE: RE: [opencms-dev] Displaying the content
that value I use for __element?
<cms:include page="commons/banners_head.html">
<cms:param name="__element" value="???" />
</cms:include>
Thanks
--
Jordi Marquès Ferré (jordi.marques at iigov.org)
Don't know if this helps, but from a quick scan through the source code,
this seems to imply that the request parameter named
I_CmsResourceLoader.PARAMETER_ELEMENT (i.e. "__element") is not defined, and
hence the creation of the corresponding Xpath expression fails.
Jon
_____
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jordi Marquès
Sent: 27 September 2006 10:11
To: The OpenCms mailing list
Subject: [opencms-dev] Displaying the content
Hi all,
I am trying to display the content of a News item in a JSP in the same
directory, but keep getting an NPE. The code below shows a minimal
example:
------- Display_News.jsp -----------------
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms"
<http://www.opencms.org/taglib/cms%22> %>
<% org.opencms.jsp.CmsJspActionElement cms = new
org.opencms.jsp.CmsJspActionElement(pageContext, request, response); %>
<cms:include page="New_News.html" />
-------------------------------------------
The exception begins:
java.lang.NullPointerException
at org.opencms.xml.CmsXmlUtils.createXpath(CmsXmlUtils.java:144)
at
org.opencms.xml.A_CmsXmlDocument.getLocales(A_CmsXmlDocument.java:255)
at
org.opencms.loader.A_CmsXmlDocumentLoader.dumpAsString(A_CmsXmlDocumentL
oader.java:118)
at
org.opencms.loader.A_CmsXmlDocumentLoader.service(A_CmsXmlDocumentLoader
.java:238)
Does anyone have any ideas on what I am doing wrong here? (What I am
actually trying to do is iterate over the news items in the folder and
display the teaser text. The iteration is working fine, but I cannot get
the content of the news item itself...)
Thanks,
--
Jordi Marquès Ferré
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060927/2fdca3ac/attachment.htm>
More information about the opencms-dev
mailing list