Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1BF3619E19 for ; Thu, 31 Mar 2016 09:05:26 +0000 (UTC) Received: (qmail 15576 invoked by uid 500); 31 Mar 2016 09:05:26 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 15525 invoked by uid 500); 31 Mar 2016 09:05:26 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 15337 invoked by uid 99); 31 Mar 2016 09:05:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Mar 2016 09:05:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id A64EE2C1F60 for ; Thu, 31 Mar 2016 09:05:25 +0000 (UTC) Date: Thu, 31 Mar 2016 09:05:25 +0000 (UTC) From: "Sergey Beryozkin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CXF-6853) Support encoded value in @ApplicationPath 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/CXF-6853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15219622#comment-15219622 ] Sergey Beryozkin edited comment on CXF-6853 at 3/31/16 9:05 AM: ---------------------------------------------------------------- Hi Jim, Let me clarify. As far as matching a request URI against a JAX-RS resource endpoint is concerned, the request URI must be encoded, and I'm talking here about the request URI part that follows WAR context and servlet path. See Path.value docs. ApplicationPath is not meant to be part of it. CXFNonSpringJaxrsServlet used to add it by default to the endpoint path but it was pointed out by integrators/users (TomEE user recently) it was not spec compliant. As I commented here, CXFNonSpringJaxrsServlet, does not do it any longer by default. It just happens that in the test I did yesterday it does add ApplicationPath to the endpoint path (when creating JAXRSServerFactoryBean). Exclamation mark can be encoded and can be not, and as far as the path matching is concerned, if the service wants to support both options, it should an option to accept both encoded and non-encoded values. But the bottom line, ApplicationPath is not part of request URI which follows web app context + servlet path because as we already know it must be kept encoded. See here: https://github.com/apache/cxf/blob/master/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/sci/JaxrsServletContainerInitializer.java#L74 This is what ApplicationPath is really for, it is part of the servlet URL pattern. CXF itself does not manage it. That is why I'm not really sure how it can be fixed. I asked you - how do you have this Application loaded ? was (Author: sergey_beryozkin): Hi Jim, Let me clarify. As far as matching a request URI against a JAX-RS resource endpoint is concerned, the request URI must be encoded, and I'm talking here about the request URI part that follows WAR context and servlet path. See Path.value docs. ApplicationPath is not meant to be part of it. CXFNonSpringJaxrsServlet used to add it by default to the endpoint path but it was pointed out by integrators/users (TomEE user recently) it was not spec compliant. As I commented here, CXFNonSpringJaxrsServlet, does not do it any longer by default. It just happens that in the test I did yesterday it does add ApplicationPath to the endpoint path (when creating JAXRSServerFactoryBean). '!' can be encoded and can be not, and as far as the path matching is concerned, if the service wants to support both options, it should an option to accept both encoded and non-encoded '!'. But the bottom line, ApplicationPath is not part of request URI which follows web app context + servlet path because as we already know it must be kept encoded. See here: https://github.com/apache/cxf/blob/master/rt/rs/http-sci/src/main/java/org/apache/cxf/jaxrs/servlet/sci/JaxrsServletContainerInitializer.java#L74 This is what ApplicationPath is really for, it is part of the servlet URL pattern. CXF itself does not manage it. That is why I'm not really sure how it can be fixed. I asked you - how do you have this Application loaded ? > Support encoded value in @ApplicationPath > ----------------------------------------- > > Key: CXF-6853 > URL: https://issues.apache.org/jira/browse/CXF-6853 > Project: CXF > Issue Type: Task > Components: JAX-RS > Affects Versions: 3.1.6, 3.0.9 > Reporter: Jim Ma > Assignee: Sergey Beryozkin > Fix For: 3.0.10, 3.1.7, 3.2.0 > > > If @ApplicationPath value is an encoded value, if client send request to http://localhost:8080/Application!/myresource and get 404 . > @ApplicationPath("ApplicationPath%21") > public class MyApp extends Application { > public java.util.Set> getClasses() { > Set> resources = new HashSet>(); > resources.add(MyResource.class); > return resources; > } > } > -- This message was sent by Atlassian JIRA (v6.3.4#6332)