It's a rather nickpicky difference, but here's the explanation:

When the request starts, base_comp and request_comp are the same.
Let's call that component /request, since you didn't name it below.

When you call <& /body &>, the base_comp is changed to /body, so that any
calls like <& SELF:method &> from within /body will go through /body's
inheritance chain.

When /body calls $m->call_next, it was not changing the base_comp to
/request, so if /request calls <& SELF:method &> it would get
/body:method instead of /request:method.

If you were not doing any SELF:method calls in /request, you will not
notice any difference.

Is that clear enough?

~ John Williams


On Wed, 19 Jul 2006, Larry Owen wrote:

> I know this is a late reply, but for the record I do this quite alot. my
> autohandler looks like:
>
> <& /header, %ARGS &>
> <& /banner, %ARGS &>
> <& /body, %ARGS &>
> <& /footer, %ARGS &>
>
> and /body contains:
>
> <div id="main">
> <snip>more stuff</snip>
> <div id="content">
> <%perl>
>   if ($r->uri !~ m/body/) {
>     $m->call_next(%ARGS);
>   }
> </%perl>
> </div>
>
> is it a bad way to handle it?
> is this going break?
>
>
> ~larry
>
> On Mon, 2006-06-26 at 11:18 -0600, John Williams wrote:
> > The ability to use $m->call_next from a helper component is at least
> > assumed, since we have tests for it.  I'm not sure if it is formally
> > documented anywhere, since it is not done very often.  It probably
> > never
> > worked correctly in the past.
> >
> > Using call_next from a helper component is tested for in
> > t/11-inherit.t
> > (see the call_next_helper component in there).  However the effect on
> > the
> > request component is _not_ tested, since the <& variants &> component
> > is
> > only called from /subdir/autohandler, and not from /subdir/normal.  If
> > you
> > add the call to <& variants &> to /subdir/normal, the problem is
> > pretty
> > obvious, since the attributes and methods get invoked all wrong.
> >
> > ~ John Williams
> >
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Mason-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mason-users
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to