cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nadine Carlton" <nadine_carl...@hp.com>
Subject Re: [C2] Problem with <util:include-file>
Date Fri, 18 May 2001 16:31:23 GMT
Hi,

   I am having the same problem as Tim.  Adding an <xsp:include>
for java.io.FileReader gets util:include-file to compile, but the file
isn't included.  I found some debug in the cocoon.log saying it was
a resource not found error because it couldn't find the file I'm specifying.
It was in the local directory with the xsp page so that seemed strange.
Still, I tried an absolute path, which Tomcat didn't
like and gave a message that it was unsafe.  I've tried a path
relative to the webapps/cocoon directory and that null pointer exceptioned
in the parser.  This is all on NT 4.0 by the way for me.

  I'm cc:ing the cocoon-dev list to see if anyone can give Tim and
I some idea how to fix this.  Also, should the <xsp:include> for
the missing java.io.FileReader include be added to the util.xsl or the xsp
autogenerated imports?

Nadine Carlton
HP

-----Original Message-----
From: Bentley, Tim <TIM.BENTLEY@ca.com>
To: Cocoon-Users (E-mail) <cocoon-users@xml.apache.org>
Date: Thursday, May 17, 2001 6:18 PM
Subject: RE: [C2] Problem with <util:include-file>


>I must have stuffed something up when I was testing before, 'cause using
the name attribute with <util:include-file> seems to  compile fine now.
Still can't actually get my file to include, however.  The generated Java
code looks fine, in as much as I understand it - which is not very far!
>
>Here's a snip of the generated Java code.  Can anyone point me in the right
direction with what might be the problem?
>
>    {
>      org.apache.cocoon.components.parser.Parser newParser = null;
>
>      try {
>        newParser = (org.apache.cocoon.components.parser.Parser)
>                    this.manager.lookup(Roles.PARSER);
>        InputSource __is = new InputSource( new FileReader(
>
XSPUtil.relativeFilename("\\test.txt", objectModel)));
>
>
>        XSPUtil.include(__is, this.contentHandler, newParser);
>      } catch (Exception e) {
>        getLogger().error("Could not include page", e);
>      }
>      finally { if (newParser != null)
>                  this.manager.release((Component) newParser);
>                } }
>
>
>Regards,
>
>
>Tim Bentley
>
>-----Original Message-----
>From: Tim Bentley [mailto:timbo@pegacat.com]On Behalf Of Bentley, Tim
>Sent: Friday, 18 May 2001 10:02
>To: 'cocoon-users@xml.apache.org'
>Subject: [C2] Patch for util.xsl
>
>
>Ok -
>
><util:include-file> uses the io.FileReader class, which wasn't included
anywhere.  Added an include for it:
>
>Index: util.xsl
>===================================================================
>RCS file:
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/language/markup
/xsp/java/util.xsl,v
>retrieving revision 1.1.1.1
>diff -u -r1.1.1.1 util.xsl
>--- util.xsl    2001/05/09 20:49:55     1.1.1.1
>+++ util.xsl    2001/05/17 23:54:22
>@@ -69,6 +69,7 @@
>         <xsp:include>java.util.Date</xsp:include>
>         <xsp:include>java.text.SimpleDateFormat</xsp:include>
>
<xsp:include>org.apache.cocoon.components.language.markup.xsp.XSPUtil</xsp:i
nclude>
>+               <xsp:include>java.io.FileReader</xsp:include>
>       </xsp:structure>
>
>       <xsl:apply-templates/>
>
>That gets my page to compile, but my file still isn't getting included in
the output.  I can't test this at the moment, but I seem to recall that in
C1 files that didn't exist generated an error - with the C2 version I can
put any old filename in and the behaviour is the same - nothing happens.
>
>I also get compile errors if I try to use the name attribute instead of the
<util:name> element.
>
><util:inlude-uri> seems to be working fine, contrary to my previous post.
>
>
>Regards,
>
>
>Tim Bentley
>
>
>> -----Original Message-----
>> From: Bentley, Tim
>> Sent: Thursday, 17 May 2001 18:41
>> To: Cocoon-Users (E-mail)
>> Subject: [C2] Problem with <util:include-file>
>>
>>
>> Not sure whether I'm doing something wrong, but I have been
>> converting some
>> C1 stuff that uses <util:include-file> over to C2, and have
>> been having
>> problems.
>>
>> Has anyone successfully used either <util:include-file> or
>> <util:include-uri> with C2?  Are there any tricks or traps
>> which make it
>> different to C1?
>>
>>
>> Regards,
>>
>>
>> Tim Bentley
>>
>>
>> ---------------------------------------------------------------------
>> Please check that your question has not already been answered in the
>> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>>
>> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
>> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
>For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message