title: Create REST Services using Java in Eclipse
body: <p>I have been looking for a few days at tutorials on this subject but either they aren't exactly what i'm looking for or I cant get them to work. I cant imagine that more people aren't confused on the subject so I will ask here. </p>
  
  <p>What I would like to create is a REST service in Eclipse that I can run on my web server and "connect to" using ajax from a separate dynamic web project. All i'm looking for here at the moment is a simple hello world example of a service returning ajax working alongside a separate web project that consumes the JSON it returns. </p>
  
  <p>Im hoping to get a usable user guide (or at least links to one) that will help me out and future people looking for this same thing. </p>
  
  <p>I have gotten as far as this simple class (i have included Jersey Jars but I dont understand what to do from here):</p>
  
  <pre><code>public class UserRestService {
  private static final Logger log = Logger.getLogger(UserRestService.class.getName());
  
  private CreateUserService createUser;
  
  @POST
  @Path("/CreateUser/{name}/{age}")
  @Consumes("text/html")
  public User createUser(@PathParam("name") String name, @PathParam("age") Integer age)            {
  
      return createUser.createUser(name, age);    
  }
  }
  </code></pre>
  
  <p>How do i get this class to be an accessible api service on my tomcat server? How do I setup another web project to consume it (I understand how to make an ajax call this is more a question of how do i setup the projects)? Where do servlets come in ? </p>