Update of /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder
In directory sc8-pr-cvs1:/tmp/cvs-serv7128/lib/HTTP/WebTest/Recorder
Modified Files:
Controller.pm
Log Message:
More some contoller fields into its temporary heap
Index: Controller.pm
===================================================================
RCS file: /cvsroot/http-webtest/HTTP-WebTest-Recorder/lib/HTTP/WebTest/Recorder/Controller.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Controller.pm 22 Apr 2003 21:43:48 -0000 1.9
--- Controller.pm 22 Apr 2003 22:07:00 -0000 1.10
***************
*** 21,30 ****
# recorder object
*recorder = make_access_method('RECORDER');
- # view (template filename)
- *view = make_access_method('VIEW');
- # cgi object
- *cgi = make_access_method('CGI');
- # request object
- *request = make_access_method('REQUEST');
# heap object
*heap = make_access_method('HEAP');
--- 21,24 ----
***************
*** 35,48 ****
my %param = @_;
- # init controller with request data
$self->recorder($param{recorder});
! $self->request($param{request});
! $self->cgi($self->create_cgi($param{request}));
! $self->view($param{action});
!
! # init heap
! $self->heap({});
! $self->heap->{controller} = $self;
! $self->heap->{response} = HTTP::Response->new(RC_OK);
# proceed request through handler chain
--- 29,34 ----
my %param = @_;
$self->recorder($param{recorder});
! $self->init_heap(%param);
# proceed request through handler chain
***************
*** 62,72 ****
}
! # configures correct HTTP headers for redirect
! sub redirect {
my $self = shift;
! my $url = shift;
! $self->heap->{response}->code(RC_FOUND);
! $self->heap->{response}->header(Location => $url);
}
--- 48,62 ----
}
! # init heap with request data
! sub init_heap {
my $self = shift;
! my %param = @_;
! $self->heap({});
! $self->heap->{controller} = $self;
! $self->heap->{cgi} = $self->create_cgi($param{request});
! $self->heap->{request} = $param{request};
! $self->heap->{view} = $param{action};
! $self->heap->{response} = HTTP::Response->new(RC_OK);
}
***************
*** 84,87 ****
--- 74,86 ----
return CGI->new($query);
+ }
+
+ # configures correct HTTP headers for redirect
+ sub redirect {
+ my $self = shift;
+ my $url = shift;
+
+ $self->heap->{response}->code(RC_FOUND);
+ $self->heap->{response}->header(Location => $url);
}
|