Skip to content

ReSTful URLs with content type extension do not work properly [SPR-5537] #10208

@spring-projects-issues

Description

@spring-projects-issues

Eberhard Wolff opened SPR-5537 and commented

I have a controller like
@RequestMapping(value = "/customer/{id}", method = { RequestMethod.GET })
public ModelAndView getById(@PathVariable("id") int id) {
}

I do a GET to http://localhost:8080/customer/42.xml to get an XML representation. Result:

org.springframework.web.util.NestedServletException: Request

processing failed; nested exception is
org.springframework.beans.TypeMismatchException:
Failed to convert value of type [java.lang.String] to required type
[int];
nested exception is java.lang.NumberFormatException: For input string:
"42.xml"

i.e. the extension is considered part of the id and therefore it fails.


Affects: 3.0 M2

Issue Links:

Referenced from: commits c178888

1 votes, 1 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