Hi Jonathan, Thanks!
By setting .. @ISA = qw(HTML::Mason::Request::ApacheHandler) .. everything (so far as tested) works as expected. It seems that the "alter_superclass" logic may not be working as I'd based my code on a combination of the documentation and a CPAN module "MasonX::Request::WithApacheSession". This module includes the line (which I had used): @ISA = qw(HTML::Mason::Request); Ideally "alter_superclass" should have changed this, however I don't know why it didn't. Many thanks for the pointers, -greg On Jul 22, 2011, at 6:40 AM, Jonathan Swartz wrote: > Sorry, I don't know. I see that you copied that code directly out of the > example in Subclassing.pod, but I've never tried to use it and can't say for > sure if its behavior is still supported. > > But presumably you should know whether your application are using > ApacheHandler or CGIHandler, so it's probably unnecessary to try to alter the > superclass dynamically. > > Jon > > On Jul 21, 2011, at 6:09 PM, Greg Wickham wrote: > >> >> Hi Jonathan, >> >> Testing the constructor of my new class the value being passed to the >> "alter_superclass" method is 'HTML::Mason::Request::ApacheHandler'. >> >> So the answer to the question seems like yes. >> >> Ideas? >> >> -greg >> >> On Jul 18, 2011, at 3:13 PM, Jonathan Swartz wrote: >> >>> Are you subclassing HTML::Mason::Request::ApacheHandler, defined around >>> line 47 of HTML::Mason::ApacheHandler? >>> >>> On Jul 16, 2011, at 4:43 AM, Greg Wickham wrote: >>> >>>> >>>> Hi All, >>>> >>>> Kind of stumped trying to get a subclass of HTML::Mason::Request working >>>> with Mason 1.42. >>>> >>>> The error is: >>>> >>>> [Fri Jul 15 07:24:09 2011] [error] [client 172.16.189.1] The following >>>> parameter was passed in the call to MyApp::Mason::Request->new() but was >>>> not listed in the validation options: ah\n\nStack:\n >>>> [/usr/share/perl5/HTML/Mason/ApacheHandler.pm:882]\n >>>> [/usr/share/perl5/HTML/Mason/ApacheHandler.pm:822]\n >>>> [/var/www/perl/MyApp/Mason.pm:41]\n [-e:0]\n, referer: >>>> http://fusion/index.html >>>> >>>> It seems that 'ah' is being passed in as an argument to the constructor of >>>> the new class (MyApp::Mason::Request) but it is not being recognised by >>>> the superclass. >>>> >>>> The new class (MyApp::Mason::Request) is very tiny / simple - at the >>>> moment the only method that exists is 'new': >>>> >>>> sub new { >>>> >>>> my $class = shift; >>>> >>>> $class->alter_superclass( >>>> $HTML::Mason::ApacheHandler::VERSION ? >>>> 'HTML::Mason::Request::ApacheHandler' : >>>> $HTML::Mason::CGIHandler::VERSION ? >>>> 'HTML::Mason::Request::CGI' : >>>> 'HTML::Mason::Request' ); >>>> >>>> my $self = $class->SUPER::new( @_ ); >>>> >>>> return( $self ); >>>> } >>>> >>>> httpd configuration is with a package: >>>> >>>> <LocationMatch ".*(\.html|\.pl|\.xml|\/)$"> >>>> DefaultType text/html >>>> SetHandler perl-script >>>> PerlHandler MyApp::Mason >>>> </LocationMatch> >>>> >>>> And in the package MyApp::Mason there is >>>> >>>> my $apacheHandler = new HTML::Mason::ApacheHandler( >>>> request_class => 'MyApp::Mason::Request', >>>> >>>> Everything kind of looks ok. >>>> >>>> Any help appreciated. >>>> >>>> -greg >>>> >>>> -- >>>> >>>> >>>> >>>> >>>> -- >>>> ------------------------------------------------------------------------------ >>>> AppSumo Presents a FREE Video for the SourceForge Community by Eric >>>> Ries, the creator of the Lean Startup Methodology on "Lean Startup >>>> Secrets Revealed." This video shows you how to validate your ideas, >>>> optimize your ideas and identify your business strategy. >>>> http://p.sf.net/sfu/appsumosfdev2dev >>>> _______________________________________________ >>>> Mason-users mailing list >>>> Mason-users@lists.sourceforge.net >>>> https://lists.sourceforge.net/lists/listinfo/mason-users >>> >> > ------------------------------------------------------------------------------ 10 Tips for Better Web Security Learn 10 ways to better secure your business today. Topics covered include: Web security, SSL, hacker attacks & Denial of Service (DoS), private keys, security Microsoft Exchange, secure Instant Messaging, and much more. http://www.accelacomm.com/jaw/sfnl/114/51426210/ _______________________________________________ Mason-users mailing list Mason-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mason-users