delphimvcframework
delphimvcframework copied to clipboard
How do I access the "root" path?
I'm creating a controller with some information and redirections that are as "root". However, the DMVC response is always 404.
Sample:
[MVCPath('/')]
TAboutController = class(TMVCController)
public
[MVCPath('/')]
[MVCHTTPMethod([httpGET])]
procedure Redirect;
// OR
[MVCPath]
[MVCHTTPMethod([httpGET])]
procedure Redirect;
[MVCPath('/about')]
[MVCHTTPMethod([httpGET])]
procedure AboutAPI;
end;
In short, this access doesn't work "http://localhost:52146/", this one also doesn't work "http://localhost:52146/about"
I noticed that there are some examples implemented this way, but they don't work either. So how can I do this?
Which samples don't work?
Il Ven 12 Lug 2024, 21:33 Bruno Silva @.***> ha scritto:
I'm creating a controller with some information and redirections that are as "root". However, the DMVC response is always 404.
Sample:
` [MVCPath('/')] TAboutController = class(TMVCController) public [MVCPath('/')] [MVCHTTPMethod([httpGET])] procedure Redirect;
// OR
[MVCPath] [MVCHTTPMethod([httpGET])] procedure Redirect;
[MVCPath('/about')] [MVCHTTPMethod([httpGET])] procedure AboutAPI;
end; ` In short, this access doesn't work "http://localhost:52146/", this one also doesn't work "http://localhost:52146/about"
I noticed that there are some examples implemented this way, but they don't work either. So how can I do this?
— Reply to this email directly, view it on GitHub https://github.com/danieleteti/delphimvcframework/issues/760, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK4ZJCRHL66ZX4YXOJHAOTZMAVPVAVCNFSM6AAAAABKZPB2TOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQYDMMRRGUZTINY . You are receiving this because you are subscribed to this thread.Message ID: @.***>
the project "..\samples\authenticationauthorization" is an example, in this project we have the controller AppControllerU with the "procedure TApp1MainController.Index" which is a direct call to a "root" (http://localhost:8080/).
In this situation, the return is "NotFound"
Another example project is "..\samples\custom_exception_handling" which has the procedure TMyController.Index; as "root".
It's important to mention that I'm using version 3.2.2(nitrogen) with Delphi 10.1
Both examples (the first one is no more contained in the project, howver I tested basic_demo_server which does almost the same thing) work in 3.4.2-magnesium-rc2. Can you create a very simple self-contained test which reproduce the problem? We have to understand if it is a Delphi 10.1 issue or a dmvcframework-3.2.2-nitrogen issue.
Unfortunately, the newer versions of DMVC do not work in Delphi 10.1. It is incompatible.
I recently tested DMVC version 3.4.1.
For example:
-
In MVCFramework.Cache, in TMVCCache.RemoveItem. the IsObjectInstance does not exist in the call lItem.Value.IsObjectInstance. Because the System.Rtti TValue does not have this property in Delphi 10.1
-
In MVCFramework.ActiveRecord, in TMVCTableMapRepository.AddTableMap the TObjectDictionary cannot resolve the TryAdd function, because it does not exist.
-It is also possible to see that there is a var declaration that is in a position that is not accepted by Delphi 10.1
We'll check ASAP.
Thanks
DT
Il Ven 6 Dic 2024, 15:11 Bruno Silva @.***> ha scritto:
Unfortunately, the newer versions of DMVC do not work in Delphi 10.1. It is incompatible.
I recently tested DMVC version 3.4.1.
For example:
In MVCFramework.Cache, in TMVCCache.RemoveItem. the IsObjectInstance does not exist in the call lItem.Value.IsObjectInstance. Because the System.Rtti TValue does not have this property in Delphi 10.1
In MVCFramework.ActiveRecord, in TMVCTableMapRepository.AddTableMap the TObjectDictionary cannot resolve the TryAdd function, because it does not exist.
Captura.de.tela.2024-12-06.110822.png (view on web) https://github.com/user-attachments/assets/62256431-395b-44aa-8ed5-c2ed0bbe245e Captura.de.tela.2024-12-06.110355.png (view on web) https://github.com/user-attachments/assets/26655a18-3c69-43d9-932e-838d63eced91
— Reply to this email directly, view it on GitHub https://github.com/danieleteti/delphimvcframework/issues/760#issuecomment-2523335258, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAK4ZJG4NJ2PBWMKQWM2W3L2EGWAJAVCNFSM6AAAAABKZPB2TOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMRTGMZTKMRVHA . You are receiving this because you were assigned.Message ID: @.***>
Any news on this? Do the new version solve the issue?
I downloaded the main sources and tested them. Apparently now there was only a problem in the MVCFramework.Nullables unit with the Float32 and Float64 types, I looked for this in System.Type and System.Math, but it seems that this does not exist in this version of Delphi.
I downloaded the main sources and tested them. Apparently now there was only a problem in the MVCFramework.Nullables unit with the Float32 and Float64 types, I looked for this in System.Type and System.Math, but it seems that this does not exist in this version of Delphi.
This in another issue and has been fixed in the referenced commit.
Let me know if all is OK now.
There was a problem comparing the objects