2
0
Эх сурвалжийг харах

* Actions were not considered in HandleRequest

git-svn-id: trunk@38401 -
michael 7 жил өмнө
parent
commit
c5348196cf

+ 14 - 5
packages/fcl-web/src/base/fphtml.pp

@@ -506,6 +506,7 @@ type
   Public
     Constructor Create(AOwner : TComponent);override;
     Procedure HandleRequest(ARequest : TRequest; AResponse : TResponse); override;
+    Property Document : THTMLDocument Read FDocument;
   end;
   
   TFPHTMLModule=Class(TCustomHTMLModule)
@@ -1167,13 +1168,21 @@ begin
       If Assigned(OnGetContent) then
         OnGetContent(Self,ARequest,FWriter,B);
       If Not B then
-        Raise EHTMLError.Create(SErrRequestNotHandled);
-      If (AResponse.ContentStream=Nil) then
         begin
-        M:=TMemoryStream.Create;
-        AResponse.ContentStream:=M;
+        Actions.HandleRequest(ARequest,FWriter,B);
+        If Not B then
+          Raise EHTMLError.Create(SErrRequestNotHandled);
+        end
+      else
+        begin
+        If (AResponse.ContentStream=Nil) then
+          begin
+          M:=TMemoryStream.Create;
+          AResponse.ContentStream:=M;
+          AResponse.FreeContentStream:=True;
+          FDocument.SaveToStream(AResponse.ContentStream);
+          end;
         end;
-      FDocument.SaveToStream(AResponse.ContentStream);
     Finally
       FreeAndNil(FWriter);
     end;