You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For 3.0 it would be very helpful if the Route had more metadata for MVC handlers. For example which class and method is the handler. Currently the MVC annotation processor does add the path as well annotation metadata but it would be helpful if it added:
Class name
Method name
Method parameters
The idea for are use case is in dev mode (or not) you could print that information out for diagnostic purposes. e.g. perhaps a meta tag on the page that says what view and controller rendered it. (the view is easy and doable today but the other meta data like class is not)
In other frameworks this information is available because they are using reflection and give you the the java reflect Method that handled the request. We do not want to do that but should give enough information to effectively get the Method (or MethodHandle) if one desires so. That is static strings like how annotations are added to the route should be enough I think.
I can put in a PR in 3.0 if you are interested?
The text was updated successfully, but these errors were encountered:
It shows the name of the controller and view. That isn't easily available in Jooby.
I had to do lots of things to port our existing metrics and logging to jooby. I had to use the route path which is often not clear at all where that path's controller is.
It is valuable for:
Metrics
Diagnostics
AOP programming
Logging
Even if the parameters are not there this would still be valuable:
Also, if we do it for mvc, we need to same on lambda routes...
Annotations are not really supported on lambdas either. I think it's fine that isn't available on lambdas. Lambdas can wire whatever name they want manually since they have the route.
In MVC there is way no way to edit aka post process the route after it is created.
I suppose if you don't want to modify the route attributes you could provide an SPI such that you call:
For 3.0 it would be very helpful if the
Route
had more metadata for MVC handlers. For example which class and method is the handler. Currently the MVC annotation processor does add the path as well annotation metadata but it would be helpful if it added:The idea for are use case is in dev mode (or not) you could print that information out for diagnostic purposes. e.g. perhaps a meta tag on the page that says what view and controller rendered it. (the view is easy and doable today but the other meta data like class is not)
In other frameworks this information is available because they are using reflection and give you the the java reflect
Method
that handled the request. We do not want to do that but should give enough information to effectively get theMethod
(orMethodHandle
) if one desires so. That is static strings like how annotations are added to the route should be enough I think.I can put in a PR in 3.0 if you are interested?
The text was updated successfully, but these errors were encountered: