I am calling a web api (J2ee, for example : /getBlDetail/{noBl}) with $resource:
return $resource('api/getBlDetail/:noBl', {}, {
'query': { method: 'GET', isArray: true},
'get': {
method: 'GET', isArray: true,
transformResponse: function (data) {
data = angular.fromJson(data);
return data;
}
}
});
J2EE :
@RequestMapping(value = "/getBlDetail/{noBl}",
method = RequestMethod.GET,
produces = MediaType.APPLICATION_JSON_VALUE)
@Timed
public List<Vente> getBlDetail(@PathVariable String noBl) {
try {
noBl = java.net.URLDecoder.decode(noBl, "UTF-8");
...
return ventes;
} catch (UnsupportedEncodingException e) {
return null;
}
}
If for example noBl = '04.00256', in java side I am only getting '04'. It seems that the "." character is not accepted. I have tried : encodeURIComponent(bl.noBl) But the problem is the same.
Is there a way to use a parameter in $resource that contains the "." character?
Thanks in advance.