如何在游戏框架中使用play-jersey?

时间:2013-08-12 08:17:49

标签: playframework jersey

我在bitcucket阅读了play-jersey主页。

但是,我仍然不知道如何在我的应用程序中使用它。

在哪里设置“jersey.path”? jersey.path = / api

我还尝试在“app / rest / resources”文件夹中创建一个资源,如下所示:

@Path("/rest/hello")
public class HelloRessource {
    @GET
    @Produces("application/json")
    public Response helloJson() {
        return Response.ok("Hello").build();
    }

    @GET
    @Produces("application/xml")
    public Response helloXml() {
        return Response.ok("Hello").build();
    }
}

当我访问“localhost:9000 / rest / hello”时,我收到了404错误。

谁能告诉我如何在比赛中设置球衣?顺便说一句,我使用play-1.2.5。 非常感谢!

0 个答案:

没有答案
相关问题