Skip to content

Combination of ControllerClassNameHandlerMapping and @RequestMappings with file extensions results in exception [SPR-6906] #11571

@spring-projects-issues

Description

@spring-projects-issues

Arjen Poutsma opened SPR-6906 and commented

When using the ControllerClassNameHandlerMapping in combination with the following controller:

@Controller
public class FooController {
	
	@RequestMapping(value = "{id}", method = RequestMethod.GET)
	public String handleView(Model model, @PathVariable("id") String id) {
	}

	@RequestMapping(value = "{id}.pdf", method = RequestMethod.GET)
	public String handlePdfView(Model model, @PathVariable("id") String id) {
	}
}

Doing a request for /foo/bar works: the id variable is assigned the value bar.
Doing a request for /foo/bar.pdf does not work, and results in an IllegalStateException.


Affects: 3.0.1

Referenced from: commits 21fd150, a0c41a0

1 votes, 2 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions