You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dave Allen Barker Jr <on...@xyz.net> on 2003/11/22 17:44:00 UTC
Proper map:read and cocoon: Protocol Behavior?
The following is from the testcase I've attached.
The |<map:read type="resource">| component is acting strange to me. Any
insights into its behavior would be much appreciated. If I should file a
bug <http://nagoya.apache.org/bugzilla/enter_bug.cgi?product=Cocoon%202>
or contribute to the wiki <http://wiki.cocoondev.org/>, please let me
know <ma...@xyz.net>. I'm using Cocoon version 2.1.3.
Testcase Examples with Expected and Actual Behavior Testcase Behavior
Number Description Expected Actual
1 <read-file/resource>
|
<map:match pattern="read-file/resource">
<map:read src="../samples/imagereader/logo.jpg"/>
</map:match>
|
The file is read and mime-type assigned by policies of servlet
engine. Seems to be as expected.
2 <read-file/resource-as-text>
|
<map:match pattern="read-file/resource-as-text">
<map:read src="../samples/imagereader/logo.jpg"
mime-type="text/plain"
/>
</map:match>
|
The file is read and mime-type is overridden by explicit assignment.
*The mime-type assignment is ignored.*
3 <read-http/read-file/resource>
|
<map:match pattern="read-http/read-file/resource">
<map:read src="http://localhost:8888/testcase/read-file/resource"/>
</map:match>
|
The file is served with the mime-type from the read http header, which
was assigned by the file read, which was assigned by the policies of the
servlet engine. Seems to be as expected.
4 <read-http/read-file/resource-as-text>
|
<map:match pattern="read-http/read-file/resource-as-text">
<map:read src="http://localhost:8888/testcase/read-file/resource"
mime-type="text/plain"
/>
</map:match>
|
The file is served with the mime-type overridden by explicit
assignment. Seems to be as expected.
5 <read-cocoon/read-file/resource>
|
<map:match pattern="read-cocoon/read-file/resource">
<map:read src="cocoon:/read-file/resource"/>
</map:match>
|
The file is served with the mime-type from the cocoon protocol read,
which was assigned by the file read, which was assigned by the policies
of the servlet engine. *Served with mime-type /|text/xml|/.*
6 <read-cocoon/read-file/resource-as-jpeg>
|
<map:match pattern="read-cocoon/read-file/resource-as-jpeg">
<map:read src="cocoon:/read-file/resource"
mime-type="image/jpeg"
/>
</map:match>
|
The file is served with the mime-type overridden by explicit
assignment. *Served with mime-type /|text/xml|/.*
Thanks for taking a sec to enlighten me, I'm sure I'm just missing
something simple.