annotate Lib/IMPL/Web/Application/Response.pm @ 63:76b878ad6596

Added serialization support for the IMPL::Object::List More intelligent Exception message Fixed encoding support in the actions Improoved tests Minor fixes
author wizard
date Mon, 15 Mar 2010 02:38:09 +0300
parents 0f3e369553bd
children 2840c4c85db8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
59
0f3e369553bd Rewritten property implementation (probably become slower but more flexible)
wizard
parents: 58
diff changeset
1 package IMPL::Web::Application::Response;
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
2 use strict;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
3
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
4 use base qw(IMPL::Object IMPL::Object::Autofill);
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
5
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
6 require IMPL::Exception;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
7 require CGI;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
8 require CGI::Cookie;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
9
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
10 use Carp;
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
11 use Encode;
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
12 use IMPL::Class::Property;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
13
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
14 #todo: add binary method to set a binary encoding, set it automatic when type isn't a text
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
15
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
16 BEGIN {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
17 public property query => prop_get | owner_set; # cgi query
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
18 public property status => prop_all, { validator => \&_checkHeaderPrinted };
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
19 public property contentType => prop_all, { validator => \&_checkHeaderPrinted }; # String
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
20 public property charset => { get => \&_charset, set => \&_charset }, { validator => \&_checkHeaderPrinted };
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
21 public property expires => prop_all, { validator => \&_checkHeaderPrinted };
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
22 public property cookies => prop_all, { validator => \&_checkHeaderPrinted }; # Hash
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
23
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
24 public property buffered => prop_all, { validator => \&_canChangeBuffer }; # Boolean
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
25 public property streamOut => prop_get | owner_set; # stream
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
26 public property streamBody => {get => \&getStreamBody }; # stream
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
27 public property isHeaderPrinted => prop_get | owner_set; # Boolean
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
28
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
29 private property _bufferBody => prop_all;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
30 private property _streamBody => prop_all;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
31 }
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
32
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
33 __PACKAGE__->PassThroughArgs;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
34
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
35 sub CTOR {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
36 my ($this,%args) = @_;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
37
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
38 $this->query(CGI->new($this->query() | {})) unless $this->query;
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
39
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
40 $this->streamOut(*STDOUT) unless $this->streamOut;
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
41 $this->buffered(1) unless defined $this->buffered;
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
42 binmode $this->streamOut, ":encoding(".$this->charset.")";
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
43 }
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
44
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
45 sub _checkHeaderPrinted {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
46 my ($this,$value) = @_;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
47
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
48 die new IMPL::InvalidOperationException() if $this->isHeaderPrinted;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
49 }
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
50
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
51 sub _canChangeBuffer {
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
52 my ($this,$value) = @_;
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
53
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
54 die new IMPL::InvalidOperationException() if $this->isHeaderPrinted or $this->_streamBody;
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
55 }
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
56
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
57 sub _charset {
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
58 my $this = shift;
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
59
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
60 if (@_) {
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
61 my $charset = $this->query->charset(@_);
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
62
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
63 my $hout = $this->streamOut;
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
64
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
65 binmode $hout;
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
66 binmode $hout, ":encoding($charset)";
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
67
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
68 return $charset;
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
69 } else {
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
70 return $this->query->charset;
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
71 }
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
72 }
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
73
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
74 sub _PrintHeader {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
75 my ($this) = @_;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
76
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
77 unless ($this->isHeaderPrinted) {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
78 $this->isHeaderPrinted(1);
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
79
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
80 my %opt;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
81
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
82 $opt{-type} = $this->contentType if $this->contentType;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
83 $opt{-status} = $this->status if $this->status;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
84 $opt{-expires} = $this->expires if $this->expires;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
85
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
86 my $refCookies = $this->cookies;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
87 $opt{-cookie} = [map CGI::Cookie->new(-name => $_, $refCookies->{$_} ), keys %$refCookies] if $refCookies;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
88
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
89 my $hOut = $this->streamOut;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
90
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
91 print $hOut $this->query->header(
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
92 %opt
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
93 );
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
94 }
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
95 }
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
96
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
97 sub getStreamBody {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
98 my ($this) = @_;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
99
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
100 return undef unless $this->streamOut;
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
101
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
102 unless ($this->_streamBody) {
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
103 if ($this->buffered) {
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
104 my $buffer = "";
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
105
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
106 $this->_bufferBody(\$buffer);
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
107
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
108 open my $hBody, ">:encoding(utf-8)", \$buffer or die new IMPL::Exception("Failed to create buffer",$!);
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
109
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
110 Encode::_utf8_on($buffer);
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
111
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
112 $this->_streamBody($hBody);
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
113 } else {
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
114 $this->_PrintHeader();
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
115 $this->_streamBody($this->streamOut);
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
116 }
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
117 }
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
118
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
119 return $this->_streamBody;
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
120 }
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
121
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
122 sub Complete {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
123 my ($this) = @_;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
124
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
125 return 0 unless $this->streamOut;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
126
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
127 my $hOut = $this->streamOut;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
128
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
129 $this->_PrintHeader();
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
130
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
131 $this->_streamBody(undef);
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
132
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
133 if ($this->buffered) {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
134 print $hOut ${$this->_bufferBody};
63
76b878ad6596 Added serialization support for the IMPL::Object::List
wizard
parents: 59
diff changeset
135 }
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
136
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
137 $this->_bufferBody(undef);
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
138 $this->streamOut(undef);
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
139
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
140 return 1;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
141 }
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
142
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
143 sub Discard {
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
144 my ($this) = @_;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
145
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
146 carp "Discarding sent response" if $this->isHeaderPrinted;
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
147
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
148 $this->_streamBody(undef);
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
149 $this->_bufferBody(undef);
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
150 $this->streamOut(undef);
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
151 }
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
152
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
153 1;
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
154
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
155 __END__
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
156
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
157 =pod
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
158
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
159 =head1 DESCRIPTION
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
160
58
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
161 Ответ сервера на CGI запрос, позволяет сформировать основные свойства заголовка и тело запроса.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
162
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
163 Объект позволяет буфферизировать вывод в тело ответа, что позволяет отменить или изменить
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
164 ответ в последний момент.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
165
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
166 Свойство C< isHeaderPrinted > можно использовать для определения были ли отправлены какие-нибудь
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
167 данные клиенту.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
168
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
169 =head1 PROPERTIES
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
170
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
171 =head2 HTTP Header
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
172
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
173 Свойства отвечающие за заголовок HTTP ответа. Эти своства могут быть изменены до тех пор пока
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
174 не будет отправлен заголовок. В противном случае выдается исключение C< IMPL::InvalidOperationException >.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
175
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
176 =over
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
177
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
178 =item C< query >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
179
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
180 CGI запрос, который используется для вывода данных, заголовка и пр. Существует всегда.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
181
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
182 =item C< status >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
183
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
184 Код ошибки HTTP. Например, '200 OK'. По умолчанию не установлен, при отправке клиенту бедт отправлен '200 ОК'.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
185
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
186 =item C< contentType >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
187
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
188 Тип MIME. По умолчанию не установлен, подразумивается 'text/html'.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
189
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
190 =item C< charset >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
191
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
192 Кодировка, синоним свойства query->charset.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
193
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
194 =item C< expires >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
195
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
196 Определяет время жизни контента, например '+10m'. По умолчанию не задано и не передается.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
197
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
198 =item C< cookies >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
199
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
200 Хеш массив с cookies, например C< { cart => ['foo','bar'], display => 'list' } >.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
201
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
202 =back
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
203
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
204 =head2 Response behaviour
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
205
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
206 Свойства отвечающие за поведение ответа.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
207
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
208 =over
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
209
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
210 =item C< buffered >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
211
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
212 C< True > - то тело ответа пишется в буффер и будет отправлено при вызове метода C< Complete >,
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
213 заголовок также будет отправлен после вызова метода C< Complete >.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
214
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
215 C< False > - тело ответа пишется непосредственно в поток к клиенту, при этом заголовок
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
216 будет отправлен при первом обращении к свойству C< streamBody >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
217
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
218 Это свойство можно менять до первого обращения к потоку для записи в тело ответа.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
219
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
220 =item C< streamOut >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
221
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
222 Стандартный вывод CGI приложения.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
223
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
224 =item C< streamBody >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
225
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
226 Поток для записи в тело ответа.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
227
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
228 =item C< isHeadPrinted >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
229
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
230 Признак того, что заголовок уже был отправлен клиенту.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
231
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
232 =back
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
233
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
234 =head1 METHODS
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
235
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
236 =over
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
237
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
238 =item C< Complete >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
239
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
240 Завершает отправку ответа.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
241
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
242 =item C< Discard >
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
243
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
244 Отменяет отправку ответа, при этом если часть данных (например, заголовок)
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
245 уже была отправлена, выдает предупреждение в STDERR.
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
246
a35b60b16a99 Configuration, late activation
wizard
parents: 57
diff changeset
247 =back
57
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
248
bf59ee1cd506 Web application main class functionality
wizard
parents:
diff changeset
249 =cut