开发者

Shorten path of REST service in JBoss Seam application

I'm pretty new to JBoss and Seam. My project has a REST service of the style

@Path("/media"开发者_如何学Python)
@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();
   }
}

I can reach this at http://localhost:8080/application/resource/rest/media/test. However, I don't like this URL at all and would prefer something much shorter like http://localhost:8080/application/test.

Can you please point me in the right direction on how to configure the application correctly? (Developing using Eclipse)


web.xml will contain seam resource servlet mapping , this should be modified to /*, and if you have more configuration to the path it will be in components.xml ,if it is resteasy seam is configured to use, it will look like the following

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜