I am working on a web project and using Spring MVC 3.1.1. Spring MVC is used to serve REST services (using URL annotations)
Regarding to my problem:
Let's say my url path for a service is as;
http://localhost:8080/MyAppName/services/meteo/queryWeatherData/lon/39.1123/lat/39.3123
And my controller method is as;
@RequestMapping(method = RequestMethod.GET, value = {"/queryWeatherData/lon/{lon}/lat/{lat}"})
public void queryWeatherData(
final @PathVariable("lon") float lon,
final @PathVariable("lat") float lat,
final HttpServletResponse response, final HttpServletRequest request) {
//
// DO STUFF and prepare response
//
}
I see that the second parameter (lat) is truncated after "." so I see that the value is 39.0 in server side.
I tried declaring a DefaultAnnotationHandlerMapping bean in my app-context.xml and set its useDefaultSuffixPattern to false but it did not work.
How can I solve this issue?