According to the javadocs, the ResourceExistsAction takes a parameter named "src". It could alternatively take a parameter named "url". Correct me if I'm wrong.
Gabriel
Mark Lundquist wrote:
On Feb 13, 2004, at 11:33 AM, Gabriel Egolf wrote:
Hi all,
I have what I hope is a simple question. Is it possible to create a resource that calls itself? Here's an example of what I'm thinking.
<map:resource name="foo"> <map:act type="resource-exists"> <map:parameter name="src" value="{../path}/foo.xml"/> <map:generate src="{../path}/foo.xml"/> <map:serialize type="xml"/> </map:act> <map:call resource="foo"> <map:parameter name="path" value="{path}/../"/> </map:call> </map:resource> .. <map:match pattern="**/foo.xml"> <map:call resource="navigation"> <map:parameter name="path" value="{1}"/> </map:call> </map:match>
What I'm hoping to accomplish is to look for a file "foo.xml" in a given directory passed as the parameter "path". If the file exists, generate it. If the file doesn't exist, look in the parent directory for it.
So far, I haven't had any luck with this. Instead of calling the resource again, I'm getting a 404 - Resource Not Found page. Yes, the file does exist in the parent directory. :)
For starters — your resource is named "foo", but you're calling a resource named "navigation"...? And this doesn't look right:
<map:parameter name="src" value="{../path}/foo.xml"/>
Where in that pipeline is anything that would use a parameter named "src"?
~ml
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]