Browse Source

* Added PreferModuleName

git-svn-id: trunk@20495 -
michael 13 years ago
parent
commit
6c671917ec
1 changed files with 16 additions and 1 deletions
  1. 16 1
      packages/fcl-web/src/base/custweb.pp

+ 16 - 1
packages/fcl-web/src/base/custweb.pp

@@ -101,6 +101,7 @@ Type
     FTitle: string;
     FTitle: string;
     FOnTerminate : TNotifyEvent;
     FOnTerminate : TNotifyEvent;
     FOnLog : TLogEvent;
     FOnLog : TLogEvent;
+    FPreferModuleName : Boolean;
   protected
   protected
     procedure Terminate;
     procedure Terminate;
     Function GetModuleName(Arequest : TRequest) : string;
     Function GetModuleName(Arequest : TRequest) : string;
@@ -136,6 +137,7 @@ Type
     Property OnLog : TLogEvent Read FOnLog Write FOnLog;
     Property OnLog : TLogEvent Read FOnLog Write FOnLog;
     Property OnUnknownRequestEncoding : TOnUnknownEncodingEvent Read FOnUnknownRequestEncoding Write FOnUnknownRequestEncoding;
     Property OnUnknownRequestEncoding : TOnUnknownEncodingEvent Read FOnUnknownRequestEncoding Write FOnUnknownRequestEncoding;
     Property OnInitModule: TInitModuleEvent Read FOnInitModule write FOnInitModule;
     Property OnInitModule: TInitModuleEvent Read FOnInitModule write FOnInitModule;
+    Property PreferModuleName : Boolean Read FPreferModuleName Write FPreferModuleName;
   end;
   end;
 
 
   TCustomWebApplication = Class(TCustomApplication)
   TCustomWebApplication = Class(TCustomApplication)
@@ -154,6 +156,7 @@ Type
     function GetOnUnknownRequestEncoding: TOnUnknownEncodingEvent;
     function GetOnUnknownRequestEncoding: TOnUnknownEncodingEvent;
     function GetRedirectOnError: boolean;
     function GetRedirectOnError: boolean;
     function GetRedirectOnErrorURL: string;
     function GetRedirectOnErrorURL: string;
+    function GetPreferModuleName: boolean;
     procedure SetAdministrator(const AValue: String);
     procedure SetAdministrator(const AValue: String);
     procedure SetAllowDefaultModule(const AValue: Boolean);
     procedure SetAllowDefaultModule(const AValue: Boolean);
     procedure SetApplicationURL(const AValue: String);
     procedure SetApplicationURL(const AValue: String);
@@ -165,6 +168,7 @@ Type
     procedure SetOnUnknownRequestEncoding(AValue: TOnUnknownEncodingEvent);
     procedure SetOnUnknownRequestEncoding(AValue: TOnUnknownEncodingEvent);
     procedure SetRedirectOnError(const AValue: boolean);
     procedure SetRedirectOnError(const AValue: boolean);
     procedure SetRedirectOnErrorURL(const AValue: string);
     procedure SetRedirectOnErrorURL(const AValue: string);
+    procedure SetPreferModuleName(const AValue: boolean);
     procedure DoOnTerminate(Sender : TObject);
     procedure DoOnTerminate(Sender : TObject);
   protected
   protected
     Procedure DoRun; override;
     Procedure DoRun; override;
@@ -190,6 +194,7 @@ Type
     property OnShowRequestException: TOnShowRequestException read GetOnShowRequestException write SetOnShowRequestException;
     property OnShowRequestException: TOnShowRequestException read GetOnShowRequestException write SetOnShowRequestException;
     Property OnUnknownRequestEncoding : TOnUnknownEncodingEvent Read GetOnUnknownRequestEncoding Write SetOnUnknownRequestEncoding;
     Property OnUnknownRequestEncoding : TOnUnknownEncodingEvent Read GetOnUnknownRequestEncoding Write SetOnUnknownRequestEncoding;
     Property EventLog: TEventLog read GetEventLog;
     Property EventLog: TEventLog read GetEventLog;
+    Property PreferModuleName : Boolean Read GetPreferModuleName Write SetPreferModuleName;
   end;
   end;
 
 
   EFPWebError = Class(Exception);
   EFPWebError = Class(Exception);
@@ -404,7 +409,7 @@ begin
     If (I>0) and (S[I]='/') then
     If (I>0) and (S[I]='/') then
       Delete(S,I,1);                      //Delete the trailing '/' if exists
       Delete(S,I,1);                      //Delete the trailing '/' if exists
     I:=Pos('/',S);
     I:=Pos('/',S);
-    if (I>0) then
+    if (I>0) or PreferModuleName then
       Result:=ARequest.GetNextPathInfo;
       Result:=ARequest.GetNextPathInfo;
     end;
     end;
   If (Result='') then
   If (Result='') then
@@ -537,6 +542,11 @@ begin
   result := FWebHandler.RedirectOnError;
   result := FWebHandler.RedirectOnError;
 end;
 end;
 
 
+function TCustomWebApplication.GetPreferModuleName: boolean;
+begin
+  result := FWebHandler.PreferModuleName;
+end;
+
 function TCustomWebApplication.GetRedirectOnErrorURL: string;
 function TCustomWebApplication.GetRedirectOnErrorURL: string;
 begin
 begin
   result := FWebHandler.RedirectOnErrorURL;
   result := FWebHandler.RedirectOnErrorURL;
@@ -593,6 +603,11 @@ begin
   FWebHandler.RedirectOnError := AValue;
   FWebHandler.RedirectOnError := AValue;
 end;
 end;
 
 
+procedure TCustomWebApplication.SetPreferModuleName(const AValue: boolean);
+begin
+  FWebHandler.PreferModuleName := AValue;
+end;
+
 procedure TCustomWebApplication.SetRedirectOnErrorURL(const AValue: string);
 procedure TCustomWebApplication.SetRedirectOnErrorURL(const AValue: string);
 begin
 begin
   FWebHandler.RedirectOnErrorURL :=AValue;
   FWebHandler.RedirectOnErrorURL :=AValue;