[opencms-dev] Reading File in system folder
Ronald Lips
ronald.lips at atobemobile.com
Fri Mar 11 10:40:54 CET 2005
Hi Daniel,
I think the line should be:
CmsFile default_body =
cms.getCmsObject().readFile"/system/modules/mymodule/default_bodies/");
regards
Ronald
_____
From: Daniel Noatnick [mailto:dno at archikart.de]
Sent: vrijdag 11 maart 2005 10:19
To: opencms-dev at opencms.org
Subject: [opencms-dev] Reading File in system folder
Hallo group,
I am a new user of opencms and I use opencms 6b1, Tomcat 4.1.30, MySQL
4.0.23 on WinXP SP2. I have create a module, and my site is located
under /sites/mysite/
In /system/modules/mymodule/elements/ is a JSP, which should read the
content of my default_body located in
/system/modules/mymodule/default_bodies/
When I try to access my default_body, I get a
CmsVfsResourceNotFoundException.
Here is my code snippet from
/system/modules/mymodule/elements/read_content.jsp
CmsJspActionElement cms = new CmsJSPActionElement(pageContext, request,
response);
CmsFile default_body =
cms.getCmsObject().readFile("../default_bodies/my_default_body");
Here I get this exception:
org.opencms.file.CmsVfsResourceNotFoundException:
[org.opencms.db.mysql.CmsVfsDriver.readResource/3]
/sites/mysite/../default_bodies/my_default_body [Code 2 - Resource not
found!]
The read_content.jsp is included as a cms:template in my default
template.
What is the right path to access my default body?
Thanks a lot
Daniel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050311/9f974491/attachment.htm>
More information about the opencms-dev
mailing list