开发者

Create Session in Restful service in EJB module

开发者 https://www.devze.com 2023-02-17 18:02 出处:网络
I am using Restful Service wi开发者_C百科th resteasy implementation and turn ejb. I want to know how we create create session and maintain state in REST service in this case.

I am using Restful Service wi开发者_C百科th resteasy implementation and turn ejb. I want to know how we create create session and maintain state in REST service in this case. Is there any examples available?

Simple example what I use:

@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);
}


This question talks about state and REST, might be interesting reading for you.


One of the constraints of REST is the stateless constraint, meaning each request from the client contains all data to service the request and any client state is stored on the client.

0

精彩评论

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

关注公众号