我们使用雷特,并存在问题,难以称之为某种@GET方法。
如果该方法的接口只有简单的参数,就不存在问题。 注
@GET
@Path("/test/{myparam}")
public FacetQueryResultImpl testMethod(@PathParam("myparam")String myparam);
但是,如果我们试图将日本宇宙开发公司作为参数,那么它似乎无法把它编为查询参数。 注
@GET
@Path("/testGet")
public FacetQueryResultImpl testMethod(ParamPojo myparam);
或
@GET
@Path("/testGet")
public FacetQueryResultImpl testMethod(@QueryParam("myparam")ParamPojo myparam);
(与ParamPojo.java合著)
public class ParamPojo
{
private String name;
private String description;
(...)
}
当我们尝试时,有时没有找到这些服务,有时我们获得“教育、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训、培训
Using @POST we are able to use a POJO has the parameter, but some of our methods don t modify anything on the server, and theref或e should use @GET.
A w或karound is to "explode" the ParamPojo, and use all of its properties as separated parameters f或 the method. But this removes the "Easy" part of "RestEasy", doesn t it?