Skip to content

@RestController should accept a bean name value [SPR-11360] #15986

@spring-projects-issues

Description

@spring-projects-issues

Jens Alm opened SPR-11360 and commented

The @RestController does not take a value to be used as bean name. I currently have two controllers exporting different versions of the same service. The different controllers reside in different packages but are named the same thing. When the context starts up I get an exception for having two conflicting beans of the same name. When using the RestController annotation it defaults to the class name which in my case is the same so the conflict is legitimate. I would like to be able to specify a name for each one like you can with @Controller. As it is I had to rename a the classes to get it to work.


Affects: 4.0 GA

Referenced from: commits 7854277

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions