Skip to main content

@Path + trailing slashes

Please note these forums are being decommissioned and use the new and improved forums at
1 reply [Last post]
Joined: 2011-01-13

Hi, first post here. I am not sure if this is a GlassFish question or not but I need to start somewhere.
I have a REST class, something along these lines:
public class Test{
public String someFunc1(@PathParam("id")long id){ ... do something ..}
public String someFunc2(@PathParam("id")long id, @PathParam("id2")long id2){ ... do something ...}
Problem is a url with an ending slash on partX without an ID does not match to any function and results in a 404. For example these work:
But this one does not:
Ideally I would like for this last case to be matched to "someFunc1".


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2011-01-13

Solved it. Just had to fix my regular expressions, I had to change the * to a + since I wanted at least 1 digit for it to be valid.
Thanks for looking.