HTTP::Server::Simple::Mason is an abstract baseclass for a standalone mason server.
SYNOPSIS
my $server = MyApp::Server->new();
$server->run;
package MyApp::Server;
use base qw/HTTP::Server::Simple::Mason/;
sub mason_config {
return ( comp_root => '/tmp/mason-pages' );
}
INTERFACE
See HTTP::Server::Simple and the documentation below.
mason_handler
Returns the server's HTML::Mason::CGIHandler object. The first time this method is called, it creates a new handler by calling new_handler.
handle_request CGI
Called with a CGI object. Invokes mason and runs the request
handle_error ERROR
If the call to handle_request dies, handle_error is called with the exception (that is, $@). By default, it does nothing; it can be overriden by your subclass.
new_handler
Creates and returns a new HTML::Mason::CGIHandler, with configuration specified by the default_mason_config and mason_config methods. You don't need to call this method yourself; mason_handler will automatically call it the first time it is called.
handler_class
Returns the name of the Mason handler class invoked in new_handler. Defaults to HTML::Mason::CGIHandler, but in your subclass you may wish to change it to a subclass of HTML::Mason::CGIHandler.
setup_escapes $handler
Sets up the Mason escapes for the handler $handler. For example, the h in
< % $name | h % >
By default, sets h to HTTP::Server::Simple::Mason::escape_utf8 and u to HTTP::Server::Simple::Mason::escape_uri, but you can override this in your subclass.
mason_config
Returns a subclass-defined mason handler configuration; you almost certainly want to override it and specify at least comp_root.
default_mason_config
Returns the default mason handler configuration (which can be overridden by entries in mason_config).
escape_utf8 SCALARREF
does a css-busting but minimalist escaping of whatever html you're passing in.
escape_uri SCALARREF
Escapes URI component according to RFC2396
Product's homepage
Requirements:
· Perl
· HTTP::Server::Simple
· HTML::Mason