On Wed, Jul 18, 2001 at 10:40:22AM -0700, Davanum Srinivas wrote:
> Try the latest Code from CVS.
> - Made the encoding attribute optional.

Thanks for replying so fast, this works fine !

> - Fixed relative path problem. (if you specify just "data.txt" it will look under 
>cocoon directory
> for it).

This still doesn't work; when I specify "data.txt", I see the exception :
java.io.FileNotFoundException:
file:/usr/local/soft/jakarta-tomcat-3.2.2/webapps/cocoon (No such file or
directory)

Actually, looking at XSPUtil.relativeFilename(), I see line 102 :
return NetUtils.getPath(context.getResource(filename).toExternalForm());

The getPath() method returns a path, not a filename, so I wonder how it could
work. Moreover, the context.getResource() method calls
javax.servlet.ServletContext.getResource() which needs to have a path begin
with "/" as an argument, according to
http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/ServletContext.html#getResource(java.lang.String)

To say the truth, I would have expected that <util:get-file-contents> could
include a file relatively to the location of the XSP file, and not the cocoon
path. I don't know if it is possible, but it would be great.

> Note that the IOException is thrown by design. The LogicSheet should not "hide" this 
>exception.

Well, in other including utilities you can find in util.xsl (i.e.
util:include-file), all exceptions are catched, so why not for
util:get-file-contents ?

Thank you for your attention.

P.S: Do you think this thread should migrate to cocoon-devel ?
-- 
Arnaud Bienvenu
http://www.generasound.com/

---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to