Jersey 1.0 如何在jersey中获取映射路径
请参考以下代码/hello/from/JohnDoe将点击sayplantextHello方法。当访问“/hello/from/JohnDoe”时,我想在日志中存储映射路径,即/hello/from/{name}。请注意,我不能修改下面的代码,但可以添加过滤器等应用程序。如何获取映射路径“/hello/from/{name}”Jersey 1.0 如何在jersey中获取映射路径,jersey-1.0,Jersey 1.0,请参考以下代码/hello/from/JohnDoe将点击sayplantextHello方法。当访问“/hello/from/JohnDoe”时,我想在日志中存储映射路径,即/hello/from/{name}。请注意,我不能修改下面的代码,但可以添加过滤器等应用程序。如何获取映射路径“/hello/from/{name}” @Path("hello") public class GenericResource { @GET @Produces
@Path("hello")
public class GenericResource {
@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("/from/{name}")
public String sayPlainTextHello(@PathParam("name") String fromName) {
return "Hello Jersey - " + fromName;
}
}