Tioma
Tioma

Reputation: 2150

Create Session in Restful service in EJB module

I am using Restful Service with 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);
}

Upvotes: 0

Views: 1140

Answers (2)

Robby Pond
Robby Pond

Reputation: 73494

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.

Upvotes: 1

Jan Zyka
Jan Zyka

Reputation: 17898

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

Upvotes: 1

Related Questions