I am using RESTEASY.
@Path("/resources")
public class MyResource {
@GET
@Path("/book")
public String get() {...}
@GET
@Path("/stuff")
public String get() {...}
}
Is it possible to package each @Path into a list or into an array? Maybe like this:
A = "/resources"
B = "/book"
C = "/stuff"
And resource would be this:
@Path("{A}")
public class MyResource {
@GET
@Path("{B}")
public String get() {...}
@GET
@Path("{C}")
public String get() {...}
}
So that I can just open the list and change the path without modify the value in resource.
Is it possible? If so, how to make it? Thanks for answers.
You can use like:
@GET
@Path("{A}")
public String getXyz(@PathParm("A") String path) {...}
path will contain "/resource"
see Path Param
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.