I would like to be able to access the following rest URLs:
The first URL works fine. I am having trouble with the $count URL using Jersey implementation of JAX-RS.
Here is the code for the resource.
@Path("/helloworld")
public class HelloWorldResource {
@GET
@Produces("text/plain")
public String getClichedMessage() {
return "Hello World!";
}
@GET
@Path("\\$count")
@Produces("text/plain")
public String getClichedMessage(
@PathParam("\\$count") String count) {
return "Hello count";
}
}
I’ve also tried “$count” in both @Path and @PathParam but that didn’t work either.
Note: If I remove the dollar sign from all the code above then it works fine for the URL localhost:9998/helloworld/count. However I need the dollar sign to be there in the URL because this will be an OData producer application.
Found the answer. Placing the dollar sign in a character class did the trick.
The above matches the following URLs.