Mason resolves top-level URIs to components by looking at $r- >filename, then figuring out which component root that file is under. See HTML::Mason::Resolver::File::apache_request_to_comp_path. That's why Perrin's changing of $r->uri didn't work, and why Hans' strategy wouldn't work either.
The advantage of relying on Apache's filename resolution is that you can use Aliases, Rewrites, etc. The disadvantage is that multiple component roots won't work at the top level the same way they would with internal component calls. Perrin, just so I understand: you want to share some components, and have some unique components, for both the top-level and internal component calls? Jon On Jul 9, 2008, at 4:12 PM, Hans Dieter Pearcey wrote: > On Wed, Jul 09, 2008 at 05:43:19PM -0400, Perrin Harkins wrote: >> Maybe I'm misunderstanding the way Mason resolves components, but if >> it gets a request for /foo/index.html, won't it look for >> /var/www/common/foo/index.html? And if it gets /bar/index.html it >> will look for /var/www/common/bar/index.html. Making both of them >> look for /var/www/common/index.html would require changing the URI >> that Mason is looking up, not the comp_root. > > So what I'm suggesting is that the handler for /foo be configured > like so: > > comp_root => [ > [ foo => '/var/www/foo' ], > [ common => '/var/www/common' ], > ], > > When a request comes in for /foo/index.html, Mason looks for the > component > '/index.html' in each of the comp_root paths in order; thus, it'll use > /var/www/foo/index.html if it exists, or /var/www/common/index.html, > or die. > > > hdp. > > ------------------------------------------------------------------------- > Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! > Studies have shown that voting for your favorite open source project, > along with a healthy diet, reduces your potential for chronic lameness > and boredom. Vote Now at http://www.sourceforge.net/community/cca08 > _______________________________________________ > Mason-users mailing list > Mason-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/mason-users > ------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08 _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users