cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Huber <>
Subject Re: work-directory
Date Sun, 14 Jul 2002 15:44:14 GMT
Nicole Natho wrote:

>We try to unterstand the init()-methode of CocoonServlet. There we found
>the following snippet:
>// first init the work-directory for the logger.
>// this is required if we are running inside a war file!
>final String workDirParam = conf.getInitParameter("work-directory");
>        if ((workDirParam != null) && (!workDirParam.trim().equals(""))) {
>            if (this.servletContextPath == null) {
>                this.workDir = new File(workDirParam);
>            } else {
>                this.workDir = IOUtils.createFile( new
>File(servletContextPath) , workDirParam);
>            }
>            this.workDir.mkdirs();
>        } else {
>            this.workDir = (File)
>            this.workDir = new File(workDir, "cocoon-files");
>            this.workDir.mkdirs();
>        }
>But after execution, we don't find the /WEB-INF/work directory. We don't
>find the entry in the web.xml (<init-param> <param-name> work-directory
>... /WEB-INF/work ...), too.
>We thought this snippet create some file anyway, because of the
>mkdirs()-methode in the else-clause.  Or did we misunderstand something?
  <question>Where do I find Cocoon's work directory</question>
      Cocoon needs a working directory for storing internal caching
      files, storing uploaded files, etc.
      You may specify the working explicitly by setting the
      servlet deployment init parameter <code>work-directory</code>.
      Setting this option you hava full control over the location
      of the working directory.
      If you don't set the deployment init paramter 
      Cocoon tries to find a suitable working directory.
      The exact location of the working directory depends on the
      deployment mode used by the servlet container.
      In case of deploying Cocoon in a "exploded directory" mode,
      the working directory is put relative to the servlet context path.
      In case of deploying Cocoon in a war mode, and the servlet container
      does not unpack the war file into a directory, Cocoon uses the
      servlet attribute <code>javax.servlet.context.tempdir</code> as
      the root directory for its <code>cocoon-files</code> directory.
      The working files and directories are located relative to the
      <code>cocoon-file</code> directory.
      As defined in the servlet specification each web application
      has its own temporary directory for writing tempory files.
      The servlet attribute <code>javax.servlet.context.tempdir</code>
      defines the location of the servlet application temporary directory.
      Thus Cocoon uses this directory for defining a directory
      <code>cocoon-files</code>. The directory <cocoon-files> is
      used for storing Cocoon working directories, and working files.

In case of tomcat check tomcat's work directory...

bye bernhard

To unsubscribe, e-mail:
For additional commands, email:

View raw message