logo       

(no subject): msg#00025

web.mason.user

Subject: (no subject)

Hello List

I am having trouble getting the callback routines to run. Any help would be greatly appreciated because this MasonX stuff looks like it rocks. I imagine it is something foolish I have done. In this instance I using the functional callbacks; however, I also tried the subclass technique. Thanks in advance.

Matt

ENVIRONMENT:
Apache 1.3.27
mod_perl 1.27
Mason::ApacheHandler::WithCallbacks-1.00
perl 5.8.0
HTML::Mason-1.22
Linux 2.4.21

ERROR:
Apache's error_log file contains the entry
"You didn't specify any callbacks. If your're not going to use callbacks, you might as well just use HTML::Mason::ApacheHandler. at /dev/null line 0"

HTML PAGE:
(Example provide with the perl module)
<table>
<tr>
<td>
% if (exists $ARGS{"answer"}) {
<p><b>Answer: <% $ARGS{"answer"} %></b></p>
% } else {
<form>
<p>Enter an epoch time: <input type="text" name="epoch_time" /><br />
<input type="submit" name="myCallbacker|calc_time_cb" value="Calculate" />
</p>
</form>
% }
</td>
</tr>
</table


using the following handler.pl:

#!/usr/bin/perl
# handler.pl

package MyMason::MyApp;
use strict;
use warnings;
use MasonX::ApacheHandler::WithCallbacks;
use Alzabo::Create;
use Alzabo::Runtime;

sub calc_time {
my $cbh = shift;
my $args = $cbh->request_args;
my $val = $cbh->value;
$args->{"answer"} = localtime($val || time);
}

my $ah = MasonX::ApacheHandler::WithCallbacks->new (comp_root => '/usr/local/apache/htdocs'
,data_dir =>
'/usr/local/apache/mason'
,callbacks => [ { cb_key =>
'calc_time'
,pkg_key
=> 'myCallbacker'
,cb =>
\&calc_time } ] );

sub handler {
my ($r) = shift;
$ah->handle_request($r);
}

1;

Mason Handler sections from http.conf:
(Actually its a file called perl.conf but included in http.conf)
Include perl.conf
############################################################
# Mason Handler
############################################################

<Directory /usr/local/apache/htdocs/black_hills>
<FilesMatch "\.html$|\.mas$">
SetHandler perl-script
PerlHandler MasonX::ApacheHandler::WithCallbacks
</FilesMatch>
</Directory>

PerlRequire /usr/local/apache/conf/handler.pl
PerlSetVar MasonAllowGlobals $Schema

############################################################
# Alzabo Handler (uses Mason)
############################################################
<Directory /usr/local/apache/htdocs/alzabo>
<FilesMatch "(\.mhtml|\.css)$">
SetHandler perl-script
PerlHandler MasonX::ApacheHandler::WithCallbacks
</FilesMatch>
</Directory>

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise