0

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);
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Tioma
  • 2,120
  • 9
  • 35
  • 52

2 Answers2

1

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

Community
  • 1
  • 1
Jan Zyka
  • 17,460
  • 16
  • 70
  • 118
1

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.

Robby Pond
  • 73,164
  • 16
  • 126
  • 119