I\'m trying out Jersey at the moment, followed this link to set up a web service in netbeans. I have my entities classes and my REST classes. It works to add, edit, delete, requ
The problem is, both methods are using path templates that match the same URIs. "{a}/{b}"
is equivalent to "{c}/{d}"
- in the same way "{username}/{password}"
is equivalent to "{from}/{to}"
. And because both methods also use the same media type, there is an ambiguity. You can fix this by using a regular expression in the path template to make it more specific. I.e. since "{from}/{to}"
should always be numbers, you can disambiguate it by changing it like follows: "{from: [0-9]+}/{to: [0-9]+}"
.
Anyway, are you sure no user will pick plain numbers from username and password? Looks like in your case it would be much better to use different URI "sub-space" for each of the two resources. E.g.: login/{username}/{password}
and ranges/{from}/{to}
.
BUT, few points on the design: