|
|
Choosing A Webhost: |
Re: CAP-AnyTemplate & mod_perl: msg#00274lang.perl.modules.cgi-appplication
On Mon, 18 Jul 2005, Michael Graham <magog@xxxxxxxxxxxx> wrote: > >> >> Trying to get CA plus some plugins working under mod_perl. >> >> CAP-AnyTemplate (v0.07) works fine as part of regular cgi script, but >> >> when run under mod_perl: >> > >> >> $self->template->config( >> >> Configs->AT_CONFIG, >> >> ); >> > >> >Do you put the call to $self->template->config inside of your >> >application's setup or cgiapp_init methods? Or is it outside all >> >methods? >> > >> It is part of cgiapp_init(). Incidentally, AT_CONFIG is inside package >> Configs, which I did not make clear in my original message (though >> obvious I hope). > >Hmmm.. your error messages indicate the HTML::Template driver is being >used, so it really does look like $self->template is not getting its >config data properly (and so it is falling back to the defaults). > >Could you try something like the following and verify that >Configs->AT_CONFIG contains what you think it contains at init time? > > sub cgiapp_init { > my $self = shift; > > # ... other init stuff goes here ... > > my $at_config = Configs->AT_CONFIG; > > use Data::Dumper; > print STDERR Dumper $at_config; > > $self->template->config( > $at_config > ); > } > >And then look at the error log. Now this is potentially very interesting! First invocation of app after server restart loads template OK, and Data::Dumper(Configs->AT_CONFIG) says: $VAR1 = { 'default_type' => 'TemplateToolkit', 'TemplateToolkit' => { 'INTERPOLATE' => '1', 'WRAPPER' => 'hilis.tmpl', 'TAG_STYLE' => 'asp' }, 'include_paths' => [ '/127.0.0.1/perl/hilis4/templates', '/127.0.0.1/perl/hilis4/templates/HILIS4' ] }; But second and subsequent invocations (ie hit browser reload button) get error message, and Data::Dumper says: $VAR1 = { 'TemplateToolkit' => { 'INTERPOLATE' => '1', 'WRAPPER' => 'hilis.tmpl', 'TAG_STYLE' => 'asp' } }; ie part of the AT_CONFIG is missing (default_type and include_paths). That could explain why it is defaulting to HTML::Template and cannot then find a template file. But what is causing this behaviour? >I tried duplicating your setup here and it does seem to work for me. >Here's what I did: I will try your setup tomorrow when I have a little time, but I don't recognise your PerlHandler code so maybe I have not set Apache/mod_perl up correctly? There is no mention of my module in httpd.conf or perl.conf, I just invoke the application via the browser, and Apache knows to run applications from the /127.0.0.1/perl/ directory using 'PerlResponseHandler ModPerl::Registry' (mod_perl 1.99). Perhaps this is the problem? -- Richard Jones Leeds, UK mailto:ra.jones@xxxxxxxxxxxxxxx --------------------------------------------------------------------- Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/ http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2 To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: CRUD/BREAD style template question, Michael Peters |
|---|---|
| Next by Date: | Re: CAP-AnyTemplate & mod_perl, Michael Graham |
| Previous by Thread: | Re: CAP-AnyTemplate & mod_perl, Michael Graham |
| Next by Thread: | Re: CAP-AnyTemplate & mod_perl, Michael Graham |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |