1 Apr 2010 15:21
JSP toolkit check if document exist (chapter 2)
Enrico Cervato <e.cervato <at> sourcesense.com>
2010-04-01 13:21:46 GMT
2010-04-01 13:21:46 GMT
Hy guys,
I would need to check in a jsp page if a document exists or not. I
would not want to do it with a previous DASL query; I would like to do
it in the jsp page.
I found this very interesting old thread in your mailing list [1] and
I would like to know if it is actually possible to have something
similar to the following snippet working:
<c:set var="testdoc"
value="${repository.fetchDocument['content/e-overheid/home1.xml']}"/>
<c:if test="${empty testdoc }">
NULL
</c:if>
[1] http://old.nabble.com/JSP-toolkit-check-if-document-exist-td16538945.html#
--
--
Enrico Cervato - 0031 (0)615293346
Open Source Software Engineer
Sourcesense - making sense of Open Source: http://www.sourcesense.com
********************************************
Hippocms-dev: Hippo CMS 6 development public mailinglist
Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
(Continue reading)
Handling the potential exception I manage to do what I wanted.
Regards,
Enrico
On Thu, Apr 1, 2010 at 4:00 PM, Dirkjan van Diepen
<d.vandiepen <at> onehippo.com> wrote:
> Hi Enrico,
>
> It should be possible to retrieve a document (and also content en metadata)
> like this:
> <c:set var="document"
> value="${repository.fetchDocument['/content/path/to/document/document.xml']}"
> />
>
> When the document is not available, an error will be thrown. It's possible
> to catch the
> fetch statement in a <c:catch> for example. Then it should be possible to
> check for
> an empty document.
>
> Regards Dirkjan
> ********************************************
> Hippocms-dev: Hippo CMS 6 development public mailinglist
RSS Feed