jbossseam应用中REST服务路径的缩短

jbossseam应用中REST服务路径的缩短,rest,jboss,seam,Rest,Jboss,Seam,我是JBoss和Seam的新手。我的项目有这种风格的REST服务 @Path("/media") @Name("mediaService") public class MediaService { @GET() @Path("/test") public Response getTest() throws Exception { String result = "this works"; ResponseBuilder builder =

我是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


你能告诉我如何正确配置应用程序吗?(使用Eclipse开发)

web.xml将包含seam资源servlet映射,该映射应修改为/*,如果您对其在components.xml中的路径有更多的配置,如果它是resteasy seam配置使用的,它将如下所示

<resteasy:application resource-path-prefix="/rest"/>


谢谢您的帮助!xml当前显示:Seam Resource Servlet/Resource/*所以我认为将
更改为/*就是您的意思。My components.xml没有任何
标记,因此我将介绍上面的内容并向您报告。一个担心是副作用:我以前玩过一次这些设置,失去了在xhtml中使用远程标记的能力,因为它总是解析到错误的路径。通过直接使用正确的javascript解决了这个问题。好吧,我只是尝试了一下,但效果是,我现在甚至看不到应用程序的开始xhtml页面。它给了我一个404。对于Seam资源Servlet,我使用
/*
,对于Resteasy,我使用
/media
有什么想法吗?嗯,我不认为可以使用与REST URL相同的模式来提供xhtml,因为xhtml必须通过faces Servlet,它们不能同时映射到/*Hm,令人惊讶的是,这么简单的事情似乎是不可能的。