【发布时间】:2026-01-31 08:50:01
【问题描述】:
我对 JBoss 和 Seam 还是很陌生。我的项目有一个风格的 REST 服务
@Path("/media")
@Name("mediaService")
public class MediaService {
@GET()
@Path("/test")
public Response getTest() throws Exception {
String result = "this works";
ResponseBuilder builder = Response.ok(result);
return builder.build();
}
}
我可以通过http://localhost:8080/application/resource/rest/media/test 与此联系。但是,我根本不喜欢这个 URL,我更喜欢像 http://localhost:8080/application/test 这样更短的 URL。
能否请您指出正确的方向,了解如何正确配置应用程序? (使用 Eclipse 开发)
【问题讨论】: