mvc-api icon indicating copy to clipboard operation
mvc-api copied to clipboard

Support sub-resource locators

Open kalgon opened this issue 5 years ago • 2 comments

I have a highly dynamic application which makes use of JAX-RS sub-resource locators. Unfortunately, those are not supported by default with MVC.

I could work around this limitation with a custom interceptor on my locator method (@ControllerLocator) which intercepts the result of the method and decorates the sub-resource with an InterceptionFactory to apply the interceptors needed for @Controller to work. This workaround depends on vendor-specific (krazo) classes like AroundController and ValidationInterceptorBinding. If the interceptors had been bound to @Controller (which could be turned into an InterceptorBinding via BeforeBeanDiscovery.addQualifier()) instead of specific annotations then it could have been implemented without relying on krazo classes.

kalgon avatar Jul 01 '20 09:07 kalgon

Thanks for your feedback. We could try to implement the support for sub-resource locators in Krazo first. If we manage to implement this correctly (including all features like validation, CSRF protection, etc.) we could add the requirement to the spec as well.

@eclipse-ee4j/ee4j-mvc-committers Thoughts?

chkal avatar Jul 02 '20 05:07 chkal

Agree! This will also most likely be faster as we will do a 1.1 (first Jakarta MVC) release and then a 2.0 (javax-jakarta namespace switch) before adding functionality to the spec.

ivargrimstad avatar Jul 02 '20 05:07 ivargrimstad