in reply to Re: Mason Interp Perl string
in thread Mason Interp Perl string
I sort of think your two options would be great, if I knew how to do either (they might just be my question).
I'm not sure what minimal code I can give you. Hows about:
package Mason::MyDynHandler; sub handler { my($r) = @_; my $output = "%print STDERR $m->session\n alert("foo");"; my $mi = HTML::Mason::Interp->new( #request_class => 'MasonX::Request::WithApacheSession' ); my $c = $mi->make_component(comp_source => $output); $realOutput = $mi->exec($c); print $realOutput; return OK; }
In the above example, I have a $r which is an Apache request. If I include the line "request_class => ...", I will be missing an 'ah' (which I assume is some ApacheHandler class, possibly HTML::Mason::ApacheHandler). If I make an HTML::Mason::ApacheHandler and try to prepare_request, it looks for the path in the request '/somepath/foo.dynjs', which doesn't exist. I would love to know how to use the "existing" interp in this context.
I don't necessarily want to do it this way, I'm just not sure how else to do it (and this doesn't work anyway).
I am configured something like:
<FilesMatch "\.dynjs$"> PerlSetVar Filter On SetHandler perl-script PerlHandler Mason::MyDynHandler PerlSetVar MasonRequestClass MasonX::Request::With +ApacheSession PerlSetVar MasonSessionClass Apache::Session::File </FilesMatch>
I don't know if this clarified anything in my question.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Mason Interp Perl string
by Anonymous Monk on Feb 09, 2012 at 21:46 UTC | |
by SleepyJay (Beadle) on Feb 09, 2012 at 22:43 UTC | |
by Anonymous Monk on Feb 09, 2012 at 23:52 UTC | |
by SleepyJay (Beadle) on Feb 10, 2012 at 21:51 UTC |