-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed wrong route prefix for inherit generic method #673
Conversation
When you don't define a |
For me it's the correct behavior. |
Look, both are without |
Yes. You can define the path with |
|
For me it's wrong, because the relative path not work and the API not allow override methods as I reported. |
If you want the URL |
Sorry, it's specific to me. |
As Otávio said, you need to annotate your generic controller with @path. On Tuesday, July 8, 2014, Denilson Telaroli notifications@github.com
Rafael Ponte |
Ok, thanks |
@garcia-jj The method is not invoked for generic controller.
If I overrided both methods the non generic add twice prefix. |
If I override both methods like the example and I not use convention work, so the @path is required and override both methods is required if override class (extractControllerNameFrom and extractPrefix). It's a workaround, but I like to use the convention. |
Have you annotated the class with |
this is an example: http://www.vraptor.org/en/docs/components/#customizing-vraptor |
This line escape the methods for generic methods. |
Seems like a bug to me... Can you open an issue, and perhaps a PR with tests that break because of this case? |
👍 |
Why you consider a bug Lucas? |
If I understand the problem is because isn't generated routes for generic methods. Is it @dtelaroli ? |
But this is the right behavior, as I know. @dtelaroli have annotation in the method, but not in the class. So vraptor will consider only annotation in the method. The controller name only is considered with have no annotation in both class and method. If you want a prefix in the route, you need to annotate the class with Because of this I ask Lucas, because may I can have a wrong knowledge about this feature. |
The PR yes, but was my wrong understanding about the @get (and others) annotations. Now, I can't to override the default route component because the methods are not being invoked. To night I will verify, I don't think that it's a bug. |
I agree with you @garcia-jj . Sorry, so I didn't understand either. |
Oh, now I see. My mistake :) |
Yes, the bug is that we are not passing properly the subclass methods the overridable protected methods that are meant to be extended. |
Indeed, @lucascs |
When I use generic controller and inherited controller have no
@Path
annotation all routes are generated without controller name prefix.Other problem is when I try to override the component PathAnnotationRoutesParser to change the default prefix it not execute the methods extractControllerNameFrom and defaultUriFor, turning impossible to override the behavior.