Getting object from @PathParam

后端 未结 1 1270
情深已故
情深已故 2020-12-20 08:46

I\'m creating a RESTful service for accessing data.

So I started writing that service, first I created a ReadOnlyResource interface with the following c

相关标签:
1条回答
  • 2020-12-20 09:04

    what I try to reach is going to /some name/some number and receive a ComplexKey instance which contains the some name and some number values from the url

    Use a @BeanParam

    public class ComplexKey {
        @PathParam("name")
        private String name;
        @PathParam("value")
        private int value;
        // getters/setters
    }
    
    @Path("/{name}/{value}")
    getById(@BeanParam ComplexKey key)
    
    0 讨论(0)
提交回复
热议问题