Rest 泽西岛2.11查看所有资源
我正在使用jersey 2.11框架来练习REST webservice。 这是我的简单类,可以正常工作:Rest 泽西岛2.11查看所有资源,rest,jersey,restful-architecture,Rest,Jersey,Restful Architecture,我正在使用jersey 2.11框架来练习REST webservice。 这是我的简单类,可以正常工作: @Path("/simple") public class Service{ @GET @Path("method1") @Produces(MediaType.TEXT_HTML) public String getMethod1() { return "Hello_1"; } @GET @Path("method2")
@Path("/simple")
public class Service{
@GET
@Path("method1")
@Produces(MediaType.TEXT_HTML)
public String getMethod1() {
return "Hello_1";
}
@GET
@Path("method2")
@Produces(MediaType.TEXT_HTML)
public String getMethod2() {
return "Hello_2";
}
}
因此,我希望有一个我所有方法(资源)的列表,例如:
我的页面索引.html
<html>
<body>
<ul>`
<li> getMethod1 </li>
<li> getMethod2 </li>
</ul>
</body>
</html>
`
- 获取方法1
- 获取方法2
或者您可以看到以下示例:[
我想要一份我所有资源的清单。
非常感谢您的帮助。如果我理解正确,您希望记录项目中的所有资源,如果这样,您可以使用或阐明如果您只是想创建一个html页面,那么您可以使用Application jersey类()和getClases方法,然后使用反射来计算所有公共端点