Skip to content
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

Spring MVC @RequestMapping Inheritance [SPR-10089] #14722

Closed
spring-projects-issues opened this issue Dec 10, 2012 · 2 comments
Closed

Spring MVC @RequestMapping Inheritance [SPR-10089] #14722

spring-projects-issues opened this issue Dec 10, 2012 · 2 comments
Assignees
Labels
status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link
Collaborator

Tan Nguyen Cong opened SPR-10089 and commented

I want to inhert in @RequestMapping,for example.

@RequestMapping("/administrator")
public abstract class AbstractController {
}

then

@RequestMapping("/language")
public class LanguageController extends AbstractContrller {

   @RequestMapping(value="list",method=RequestMethod.GET)
   public String list() {
      //Get from database
       return "list";
   }
}

but administrator/language/list doesn't work??is there any way?? Thanks for helps.


No further details from SPR-10089

@spring-projects-issues
Copy link
Collaborator Author

Tan Nguyen Cong commented

Nobody can't help me.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

No, this only works for @RequestMapping annotations at the method level and the type level. I.e. the type level expresses the primary mapping and the method level extends or augments it. It doesn't work like that across super types and I think it would get confusing quite quickly if paths were derived as a result of combining type and method annotations as well as any type and method annotations in parent classes and interfaces.

@spring-projects-issues spring-projects-issues added status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants