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

Provide a way to overwrite Controllers [SPR-10784] #15410

Closed
spring-projects-issues opened this issue Jul 26, 2013 · 4 comments
Closed

Provide a way to overwrite Controllers [SPR-10784] #15410

spring-projects-issues opened this issue Jul 26, 2013 · 4 comments
Labels
in: web status: bulk-closed

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues commented Jul 26, 2013

Cemo Koc opened SPR-10784 and commented

Please provide a way to overwrite Controllers without creating ambiguous mappings.

Use case: I am using a library which is providing excellent spring components for my business. However there are some business requirements and I need to extend provided Controllers slightly.


Affects: 3.2.3

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 26, 2013

Rossen Stoyanchev commented

You could create a custom RequestMappingHandlerMapping that overrides initHandlerMethods() in order to disable auto-detection of controller methods and instead register controller methods programmatically by calling detectHandlerMethods(Object). If this custom RequestMappingHandlerMapping is deployed at a lower order (i.e. higher priority) effectively it should override other controller methods.

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jul 26, 2013

Cemo Koc commented

Thanks for the suggestion Rossen. I have implemented a custom ImportBeanDefinitionRegistrar to remove some beans. I am usually avoiding to change single access points such as RequestMappingHandlerMapping to prevent another problem.

I have filed this issue to have native support by Spring to overwrite mappings.

The first thing come to my mind is having another attribute such as overwritable at RequestMapping Annotation.

Please note that this issue is not trying to solve all ambiguous mappings. I had intention to solve only inheritance problem and provide a way to overwrite a mapping.

Thanks

@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Aug 16, 2013

Cemo Koc commented

It seems that Conditional annotation will help me. Am I right?

@spring-projects-issues spring-projects-issues added status: waiting-for-triage type: enhancement in: web and removed type: enhancement labels Jan 11, 2019
@rstoyanchev rstoyanchev added status: bulk-closed and removed status: waiting-for-triage labels Jan 11, 2019
@spring-projects-issues
Copy link
Collaborator Author

@spring-projects-issues spring-projects-issues commented Jan 12, 2019

Bulk closing outdated, unresolved issues. Please, reopen if still relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web status: bulk-closed
Projects
None yet
Development

No branches or pull requests

2 participants