[opencms-dev] cms:contentload and expired objects

Mathias Lin | SYSVISION mail at mathiaslin.com
Mon Jun 15 12:46:51 CEST 2009


You can put a try-catch block around the content load tag and redirect to
another page if you get an exception is thrown.


Kessler Marcel wrote:
> 
> hi
> 
> we have the following situation:
> in a jsp-page, we display an object that expires at some time.
> after the object expired, we get the 404 page, as obviously the object
> cannot be found anymore, see also log:
> 
> SEVERE: Servlet.service() for servlet jsp threw exception
> org.opencms.file.CmsVfsResourceNotFoundException: Resource
> "/de/_configuration/context-objects/context-object
> -items/context-object-aktuell2.html" was not found.
>         at
> org.opencms.db.CmsSecurityManager.checkPermissions(CmsSecurityManager.java
> :5400)
>         at
> org.opencms.db.CmsSecurityManager.checkPermissions(CmsSecurityManager.java
> :5375)
>         at
> org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:580
> 1)
>         at
> org.opencms.db.CmsSecurityManager.readResource(CmsSecurityManager.java:398
> 7)
>         at org.opencms.file.CmsObject.readResource(CmsObject.java:3470)
>         at org.opencms.file.CmsObject.readFile(CmsObject.java:2772)
>         at org.opencms.file.CmsObject.readFile(CmsObject.java:2743)
>         at
> org.opencms.file.collectors.CmsDefaultResourceCollector.getSingleFile(CmsD
> efaultResourceCollector.
> java:338)
>         at
> org.opencms.file.collectors.CmsDefaultResourceCollector.getResults(CmsDefa
> ultResourceCollector.jav
> a:174)
>         at
> org.opencms.jsp.CmsJspTagContentLoad.init(CmsJspTagContentLoad.java:867)
>         at
> org.opencms.jsp.CmsJspTagContentLoad.doStartTag(CmsJspTagContentLoad.java:
> 369)
>         at
> org.apache.jsp.WEB_002dINF.jsp.online.system.modules.ch_xxx_site.elements.
> context_005fob
> ject_jsp._jspx_meth_cms_005fcontentload_005f0(context_005fobject_jsp.java:
> 122)
>         at
> org.apache.jsp.WEB_002dINF.jsp.online.system.modules.ch_xxx_site.elements.
> context_005fob
> ject_jsp._jspService(context_005fobject_jsp.java:93)
> 
> my question:
> is there a way to check within the jsp if the object I want to load
> exists, before we load it and get this exception?
> 
> thanks for an answer
> marcel
> 
> 
> 


-----
Mathias Lin
SYSVISION Ltd., China
http://www.sysvision.com
-- 
View this message in context: http://www.nabble.com/cms%3Acontentload-and-expired-objects-tp24031920p24032218.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list