if I request the component "/a/b/foo", mason will search:
"/a/b/foo", (failed)
"/a/b/dhandler" (failed)
"/a/dhandler" (failed)
"/dhandler" (found it)
I was expecting it to find "/foo". This is the depth first search for
method calls: if foo() is called, it will
My question is whether there is a way to make a compoent call search the way
the method search works, i.e., depth first?
This will allow me to override the "foo" component in a subfolder.

I am new to Mason, so there may be an easy way to do it...

but if not you could always have dhandler find the component in the chain and run it (a little more complex since it would have to re-search forward thru the chain) -- for example, /dhandler could analyze the calling path and search forward for "foo" (and even cache where it is located)... or you could place a dhandler in each subdir that just looks for "foo" within that subdir (easier/faster to find since it wont have to search a chain, but more of a pain since you will have to put a dhandler in every dir).

The dhandler would know what component to look for by analyzing the $ENV variables to see what path the end user called through apache.

If you want to go the route of having dhandler just search the current directory to see if "foo" exists:

============
my $FILE = $ENV{SCRIPT_NAME};
$FILE =~ s#^.*\/##;

## add code here to make sure the component exists

$m->comp($FILE);
============

this is off the top of my head, so you may need to play around with it a bit. (and again there is probably some really simple way to accomplish what you want to do that I don't know about yet :)




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to