Re:Re: [opencms-dev] Reading File in system folder

dno at archikart.de dno at archikart.de
Mon Mar 14 16:57:19 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 --------------
A non-text attachment was scrubbed...
Name: GWAVA_unknown.dat
Type: application/octet-stream
Size: 2083 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050314/223b4d18/attachment.obj>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050314/223b4d18/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mime.822
Type: application/octet-stream
Size: 11512 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050314/223b4d18/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Part.002
Type: application/octet-stream
Size: 241 bytes
Desc: not available
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20050314/223b4d18/attachment-0002.obj>
-------------- next part --------------
AdmID:3F562B49DCFAFD3C1413322D03028BA0


More information about the opencms-dev mailing list