我正在使用带有resteasy实现的Restful Service并转向ejb。 我想知道在这种情况下我们如何在 REST 服务中创建 session 并维护状态。 有没有可用的例子?
我使用的简单示例:
@Stateless
public class TestResource implements TestResourceLocal {
@Override
public test test(String id, String param) {
//todo
}
}
@Local
@Path("/affilate")
public interface AffiliateResourceLocal {
@GET
@Path("{id}-{param}")
@Produces("application/json")
public void test(@PathParam("id") String id, @PathParam("param") String param);
}
最佳答案
这个question关于状态和 REST 的讨论,对您来说可能会很有趣。
关于java - 在EJB模块中的Restful服务中创建Session,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5327775/