From commits-return-34354-apmail-tomee-commits-archive=tomee.apache.org@tomee.apache.org Sun Mar 29 16:00:57 2015 Return-Path: X-Original-To: apmail-tomee-commits-archive@www.apache.org Delivered-To: apmail-tomee-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2F6531016B for ; Sun, 29 Mar 2015 16:00:57 +0000 (UTC) Received: (qmail 13424 invoked by uid 500); 29 Mar 2015 16:00:57 -0000 Delivered-To: apmail-tomee-commits-archive@tomee.apache.org Received: (qmail 13400 invoked by uid 500); 29 Mar 2015 16:00:57 -0000 Mailing-List: contact commits-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tomee.apache.org Delivered-To: mailing list commits@tomee.apache.org Received: (qmail 13390 invoked by uid 500); 29 Mar 2015 16:00:57 -0000 Delivered-To: apmail-openejb-commits@openejb.apache.org Received: (qmail 13386 invoked by uid 99); 29 Mar 2015 16:00:57 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 29 Mar 2015 16:00:57 +0000 Date: Sun, 29 Mar 2015 16:00:56 +0000 (UTC) From: "Sebastian Daschner (JIRA)" To: commits@openejb.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (TOMEE-1535) JAX-RS Subresource paths are chosen incorrectly MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/TOMEE-1535?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14385832#comment-14385832 ] Sebastian Daschner commented on TOMEE-1535: ------------------------------------------- Ok, great. So this will be fixed that the default behavior will be to only consider 'real' root resource classes as entry points? Actually users usage sounds a bit strange to me, as taking subresource classes as resource entry points doesn't work in other application servers as well - as it is against the standard ... > JAX-RS Subresource paths are chosen incorrectly > ----------------------------------------------- > > Key: TOMEE-1535 > URL: https://issues.apache.org/jira/browse/TOMEE-1535 > Project: TomEE > Issue Type: Bug > Affects Versions: 2.0.0 > Reporter: Sebastian Daschner > > When using a JAX-RS root resource with a subresource, the path of the subresources are evaluated in a wrong way. > Consider following code: > @Stateless > @Path("/") > public class RootResource { > @Context > ResourceContext resourceContext; > @GET > public String getRoot() { > return "root"; > } > @Path("models") > public ModelsResource models() { > return resourceContext.getResource(ModelsResource.class); > } > } > and: > public class ModelsResource { > @GET > public String getAll() { > return "all"; > } > @GET > @Path("{id}") > public String get(@PathParam("id") final String id) { > return "model_" + id; > } > } > The paths of the resources which TomEE evaluates are: > /resources/ -> String getRoot() > /resources/ -> String getAll() > /resources/{id} -> String get(String) > But the correct way due to the spec would be > /resources/models/ -> getAll() and > /resources/models/{id} -> get(String). -- This message was sent by Atlassian JIRA (v6.3.4#6332)