Skip to content

@ResponseBody with method that return void throws "Could not resolve view exception". [SPR-6935] #11600

Closed
@spring-projects-issues

Description

@spring-projects-issues

James King opened SPR-6935 and commented

@RequestMapping("/hello.html")
@ResponseBody
public void helloworld(){
System.out.println("Hello World!")
}

The code above will throw ServletException, Could not resolve view with name hello.

I think a method with ResponseBody annotation should be different with a method without ResponseBody annotation. The above method should do nothing after return.


Referenced from: commits eddc5b8

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