[Catalyst] Form handling, urls and web design

Chisel Wright chisel at herlpacker.co.uk
Tue Jan 24 15:44:20 CET 2006


On Tue, Jan 24, 2006 at 01:41:10PM +0100, Zbigniew Lukasiak wrote:
> sub default : Private {
>     my ( $self, $c ) = @_;
>     $c->response->status(404);
>     $c->response->body("404 Not Found");
> }

Bizarrely, I only see '404 Not' in my browser from this.
Same for ->output('404 Not Found') ?

A quick check, and it seems that it's chopping off the last "word" for
whatever I put in the body or output there.


Some investigation and it seems I can recreate it as shown below.

If you comment out the fillform() line in end():

  one two three four

If you enable it:

  one two three

Any idea what's going on with that? It's the same for me on
(Catalyst/CP:FillInForm) 5.61/0.06 and 5.63/0.05


Chisel

---- cut here ----
package Scratch;

use strict;
use warnings;

use Catalyst qw/-Debug DefaultEnd Static::Simple FillInForm/;
our $VERSION = '0.01';

__PACKAGE__->config( name => 'Scratch' );
__PACKAGE__->setup;

sub default : Private {
    my ( $self, $c ) = @_;

    $c->response->status(404);
    $c->response->body( 'one two three four' );
}

sub end :Private {
    my ( $self, $c ) = @_;

    $c->NEXT::end( $c );

    $c->fillform( $c->stash->{formdata} );
}

1;
---- cut here ----

-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

This is not an automated signature. I type this in to the bottom of every
message. 



More information about the Catalyst mailing list