Search code examples
ajaxejbpojo

Using a 2.1 EJB for a ReST Service


I have a 2.x stateless session EJB as a ReST service using Jersey.

@Path("/foo)
public class FooEjb...{

  @GET
  @Produces({MediaType.APPLICATION.JSON})
  public ArrayList getAList(){

  }
}

The EJB is deployed in Weblogic. Will Weblogic manage the session bean, and control how many instances are made? I'm using this for an ajax call to populate a dropdown. Is this a good idea, or should I just use a POJO? I am not using, and cannot use, Spring.


Solution

  • With Java EE 5, you cannot implement REST resources with Stateless Session Beans (that's only possible since Java EE 6).