【发布时间】:2010-11-25 12:08:38
【问题描述】:
这就是我想要做的:
@Path("/finder")
public class Finder {
@Path("/{name}")
public Proxy find(@PathParam("name") String name) {
Object found = /* some object found by name */
return new Proxy(found);
}
}
public class Proxy {
private Object obj;
public Proxy(Object found) {
this.obj = found;
}
@GET
@Path("/")
public String info() {
return /* some meta-information about the object */
}
@Path("/")
public Object passthru() {
return this.obj;
}
}
我正在尝试启用:
GET /finder/alpha -> Proxy.info()
GET /finder/alpha/something -> obj.something()
我走对了吗?与此同时,泽西说:
WARNING: A sub-resource method, public final java.lang.String com.XXX.Proxy.info(),
with URI template, "/", is treated as a resource method
【问题讨论】: