Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matching errors for sub-resource methods with equivalent URI templatesregexs but different template variables #273

Closed
jerseyrobot opened this issue Aug 28, 2007 · 8 comments

Comments

@jerseyrobot
Copy link
Contributor

Given the following resource class:

@uritemplate("/")
static public class SubResourceMethodsWithDifferentTemplates {
@uritemplate("

{foo}

")
@HttpMethod
public String getFoo(@UriParam("foo") String foo)

{ return foo; }

@uritemplate("

{bar}")
@HttpMethod
public String postBar(@UriParam("bar") String bar) { return bar; }
}

The Java method postBar will not function correctly to a POST request that
matches the URI template "{bar}

".

See the unit test [1]:

SubResourceHttpMethodsTest.testSubResourceMethodsWithDifferentTemplates

and the email thread [2] on the users list.

[1]
https://jersey.dev.java.net/source/browse/checkout/jersey/trunk/jersey/test/com/sun/ws/rest/impl/subresources/SubResourceHttpMethodsTest.java?rev=170
[2] https://jersey.dev.java.net/servlets/BrowseList?list=users&by=thread&from=895080

Environment

Operating System: All
Platform: All

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Reported by sandoz@java.net

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Was assigned to sandoz@java.net

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
sandoz@java.net said:
The URI templates are equivalent in terms of matching regexs. However, the URI
template variables are different.

First, the HTTP methods need to be grouped as per the regular expression of the
URI template. Second, the URI template functionality needs to be split up so
that the template variables are retained per the resource method.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
sandoz@java.net said:
Workaround:

Use the same template variables for URI templates of sub-resource methods with
equivalent regular expressions.

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
sandoz@java.net said:
Fixed

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
Marked as fixed on Friday, June 3rd 2016, 1:19:26 am

@jerseyrobot
Copy link
Contributor Author

@glassfishrobot Commented
This issue was imported from java.net JIRA JERSEY-1

@jerseyrobot
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant