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

PathVariables of type double [SPR-6528] #11194

Closed
spring-projects-issues opened this issue Dec 6, 2009 · 3 comments
Closed

PathVariables of type double [SPR-6528] #11194

spring-projects-issues opened this issue Dec 6, 2009 · 3 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 6, 2009

Christopher Anderson opened SPR-6528 and commented

Take the following REST endpoint:

 
@RequestMapping("/lat/{latitude}/long/{longitude}")
public void testLatLong(@PathVariable Double latitude, @PathVariable Double longitude) {
	System.out.println("Latitude = " + latitude);
	System.out.println("Longitude = " + longitude);
}

If you hit this with the URL

/lat/123/long/456 

However, if the URL contains doubles with a decimal place e.g.:

/lat/2.3/long/445

The endpoint is not longer hit, i.e. we get a 404.

Interestingly, if we change the type of the PathVariables to String:

 
@RequestMapping("/lat/{latitude}/long/{longitude}")
public void testLatLong(@PathVariable String latitude, @PathVariable String longitude) {
	System.out.println("Latitude = " + latitude);
	System.out.println("Longitude = " + longitude);
}

It will not work when latitude or longitude contains a fullstop. However, a comma will work instead of a fullstop in this case.


Affects: 3.0 M4

Issue Links:

Referenced from: commits 8678652

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 6, 2009

Christopher Anderson commented

This issue does relate to #10448, which is still open.

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Dec 7, 2009

Arjen Poutsma commented

This should be fixed now, as part of the fix for #11148. Can you try a upcoming snapshot and see if it works for you?

BTW: #10448 is not open, but closed, with a working workaround.

@spring-projects-issues
Copy link
Collaborator Author

Christopher Anderson commented

This is now fixed in the latest nightly build.

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: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants