[opencms-dev] Reading File in system folder

Daniel Noatnick dno at archikart.de
Fri Mar 11 10:57:14 CET 2005


Hi Ronald,

Thanks. That work perfectly.


  ----- Original Message ----- 
  From: Ronald Lips 
  To: The OpenCms mailing list 
  Sent: Friday, March 11, 2005 10:40 AM
  Subject: RE: [opencms-dev] Reading File in system folder


  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


------------------------------------------------------------------------------




  _______________________________________________
  This mail is send to you from the opencms-dev mailing list
  To change your list options, or to unsubscribe from the list, please visit
  http://mail.opencms.org/mailman/listinfo/opencms-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050311/5d8eaab6/attachment.htm>


More information about the opencms-dev mailing list