You seem to be having a lot of trouble with this. Have you considered using flow? With the below, if the file exists, the pattern="exists" pipeline will be shown, otherwise the pattern="non-existent" pipeline will be shown.

<map:match pattern="page">
 <map:call function="exists">
  <map:parameter name="test-uri" value="context://{request-param:ID}.xml"/>
   <map:parameter name="exist-uri" value="exists"/>
   <map:parameter name="non-exist-uri" value="non-existent"/>
 </map:call>
</map:match>

<map:match pattern="exists">
 whatever
</map:match>

<map:match pattern="non-existent">
 whatever
</map:match>

In your sitemap, just before the <map:pipelines> element:
 <map:flow language="javascript">
   <map:script src="flow/exists.js"/>
 </map:flow>

Create a file called flow/exists.js:

function exists() {
 var file = new java.io.File(cocoon.parameters["test-uri"]);
 if (file.exists()) {
    cocoon.sendPage(cocoon.parameters["exists-uri"];
 } else {
    cocoon.sendPage(cocoon.parameters["non-exist-uri"];
 }
}

HTH. Regards, Upayavira

Mustafa Ali, Halgurt wrote:

Oh, you are right, I changed it, but the pipeline still choose the second part, no matter whether the file exists or not, it ignores the <act>...</act> part, do you have an Idea what is perhaps wrong?

Thanks,
Halgurt
PS: I am a Kurd and my first name is Halgurt, we don't have surnames, Mustafa is my 
father and Ali my Grandfather.

-----Ursprüngliche Nachricht-----
Von: Olivier Billard [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 19. September 2003 10:02
An: [EMAIL PROTECTED]
Betreff: Re: File existence


Hi Halgurt (I'm french and didn't manage to see what is your name and first name, so sorry if i'm wrong),

Please check if you *really* didn't wrote {request-parameter:ID} instead of {request-param:ID}, because the error seem to point a mistake of this type...
see :
cause: org.apache.avalon.framework.component.ComponentException: *input-modules*: ComponentSelector could not find the component for hint [*request-parameter*] (key [*request-parameter*])


-> this should be request-param...

--
Olivier


On 19/09/2003 10:30, Mustafa Ali, Halgurt wrote:




Sure, here is it:




<snip/>




cause: org.apache.avalon.framework.component.ComponentException: input-modules: ComponentSelector could not find the component for hint [request-parameter] (key [request-parameter])



-----Ursprüngliche Nachricht-----
Von: Olivier Billard [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 19. September 2003 09:19
An: [EMAIL PROTECTED]
Betreff: Re: AW: AW: AW: AW: File existence


Can you send the exact error and the stack trace you got ?








--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to