我的代码是这样的
@Path("/TestClass")
public class Test implements Serializable {
@GET
@Path("/hello")
public Response heloMessage() {
String output = "Hello Word!!!!!!!!!";
return Response.status(200).entity(output).build();
}
@GET
@Path("/get")
@Produces("application/json")
public EmailJobData getProductInJSON() {
EmailJobData product = new EmailJobData();
product.setBody("Test");
product.setHost("Test data");;
return product;
}
我的web.xml文件是全空的 . 我创建了一个类并扩展 javax.ws.rs.core.Application
当我去的时候,heloMessage函数运行正常
http:// localhost:8080 / RemoteQuartzScheduler / rest / TestClass / hello
就像我试图去的那样
http:// localhost:8080 / RemoteQuartzScheduler / rest / TestClass / get
要访问getProductInJSON函数,没有任何反应 . 没有错误信息,没有...当我也调试时,它也没有进入该功能 .
我做错了什么?提前致谢 .