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

Better description for DispatcherServlet's "No adapter for handler: Does your handler implement a supported interface like Controller?" exception message [SPR-8338] #12986

Closed
spring-projects-issues opened this issue May 16, 2011 · 2 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Andrei Stefan opened SPR-8338 and commented

At the moment DispatcherServlet in its getHandlerAdapter() method throws an exception in case no adapter is found for a specific handler and the message the exception contains puts more focus on the idea that the handler might not implement a certain interface.

Could be worth considering another message, that should put equal focus on the missing interface implementation and, also, on the fact that the adapter itself might not be defined for that particular handler? Maybe, something around these lines: "No adapter for handler [" + handler + "]: Does your handler implement a supported interface like Controller or have you defined all needed handler adapters?"


Affects: 2.0.9, 2.5.6, 3.0.5

1 votes, 4 watchers

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

The message should be updated since the Controller interface is not commonly used any more.

@spring-projects-issues
Copy link
Collaborator Author

Thomas Whitmore commented

I ran into this message, with my Controller class already implementing the Controller interface. It's wrong & misleading.

The actual requirement, was to declare an "org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" bean in my config.

On a side note: I'm going to to Controllers (and my own custom base-class). The annotations stuff is weak, the old Controller method-heirarchies are horrible & branchy, and for a mid-size application I can just capture the necessary generality so much better.

Rossen: I've written & used custom base controllers (Search and Edit), with very good success, in a project some years before. My factoring & what method stubs I provide, are quite different from eg the SimpleFormController & ancestors.

Email me if you're interested to discuss: twhitmore dot nz at gmail.

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.2 M2 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants