[Catalyst] C::P::SubRequest and $c->request->param

Renaud renaud at linuxaddicts.com
Mon Nov 20 17:03:11 GMT 2006


Alright, thanks.

Actually I was using it to generate a mail from a TT template (that's the
example given in C::P::Email's doc), I guess the workaround in my case
will be to use the View's render method.

Renaud

>
> --- Renaud <renaud at linuxaddicts.com> wrote:
>
>> Hello,
>>
>> I am not sure whether this is a normal behaviour or
>> a bug, but this is
>> what I experienced using the SubRequest plugin:
>> (everything's up to date)
>>
>> sub bleh : Local {
>>
>>     my ($self, $c) = @_;
>>
>>     my $body = "Before subreq, foo == " .
>> $c->req->param('foo');
>>     $c->subreq('/index');
>>     $body .= "\nAfter subreq, foo == " .
>> $c->req->param('foo');
>>     $c->res->body($body);
>>
>> }
>>
>> sub index : Private {
>>     my ($self, $c) = @_;
>>     $c->res->body("index");
>> }
>>
>>
>> When calling http://localhost:3000/bleh?foo=foo,
>> this will output:
>>
>> Before subreq, foo == foo
>> After subreq, foo ==
>>
>> Is this normal that SubRequest destroys the original
>> parameters, am I
>> doing something wrong?
>>
>> Regards,
>> Renaud
>
> Hi,
>
> I've also had this (and other) problems with the
> current SubRequest plugin.  There is an update to
> SubRequest in the Catalyst repository which is
> supposed to be a lot better.  You might want to give
> it a try.  I tried it out a month or so ago and got
> some strange errors that I couldn't understand well
> enough to contribute meaningfully.
>
> The only hack around this I found is to use LWP to
> create a full new request.  This will give you a
> totally isolated request (and incidentally performs
> pretty well if you are on a multicpu box) but of
> course you'd have to add in any cgi params or post
> bodies manually.  Also if you have authentication on
> the server you'll need to handle that as well.
>
> --john
>>
>>
>>
>> _______________________________________________
>> List: Catalyst at lists.rawmode.org
>> Listinfo:
>> http://lists.rawmode.org/mailman/listinfo/catalyst
>> Searchable archive:
>>
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
>> Dev site: http://dev.catalyst.perl.org/
>>
>
>
>
>
> ____________________________________________________________________________________
> Sponsored Link
>
> Degrees online in as fast as 1 Yr
> MBA, Bachelor's, Master's, Assoc
> http://yahoo.degrees.info
>
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>





More information about the Catalyst mailing list