Getting object from @PathParam

烈酒焚心 提交于 2019-11-29 12:54:07

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)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!