You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2015/09/30 15:58:04 UTC

[jira] [Commented] (CXF-6619) getting 405 instead of 404 for unmatched pathparam

    [ https://issues.apache.org/jira/browse/CXF-6619?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14936864#comment-14936864 ] 

Sergey Beryozkin commented on CXF-6619:
---------------------------------------

This issue appears to be invalid, a subresource locator pattern matches v2.0, and then goes to a subresource which only has GET hence it is 405

> getting 405 instead of 404 for unmatched pathparam
> --------------------------------------------------
>
>                 Key: CXF-6619
>                 URL: https://issues.apache.org/jira/browse/CXF-6619
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.2
>            Reporter: naresh buruzula
>             Fix For: NeedMoreInfo
>
>
> @Component
> @Path("/files")
> public class FilesService{   
>  @AutoWired
>  private FileGetService fileGetService;
>  @POST  
>  @Path("/v1.0")
>  public void saveFile(final InputStream inputFile){
>   //some logic
>  }
>  @Path("/{fileId}")
>  public FileGetService getFile(){
>    return fileGetService;
>  }
> }
> This class FilesService has two methods one to serve GET and other POST
> getFile() - sub-resource locator which returns a instance of FileGetService
> saveFile(..) - resource endpoint which has logic to serve the POST requests
> When a class has both sub-resource locator and a resource endpoint any request with wrong pathparam is throwing 405 instead of 404.
> For Example a POST request with below URL throws 405 instead of 404. 
> http://localhost:8080/context/files/v2.0
> Ideally it should have thrown 404 as path param is v2.0 instead of v1.0.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)