我对 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
。但是,我根本不喜欢这个网址,并且更喜欢更短的网址,例如http://localhost:8080/application/test
.
您能否为我指明如何正确配置应用程序的正确方向? (使用Eclipse开发)
web.xml将包含seam资源servlet映射,这应该修改为/*,如果你对路径有更多配置,它将在components.xml中,如果是resteasy Seam配置使用,它将看起来像下列的
<resteasy:application resource-path-prefix="/rest"/>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)