title: Why use a framework for RESTful services in Java instead of vanilla servlets
body: <p>I know there are a few questions regarding the libraries you can use to do RESTful services in Java, but what is the value in using them against vanilla implementations. I mean, if i was looking to create <a href="https://stackoverflow.com/questions/6774904/nested-rest-routing">the url structure described by Wim</a></p>
  
  <ul>
  <li>www.example.com/images</li>
  <li>www.example.com/images/id/num</li>
  <li>www.example.com/images/tag/num</li>
  <li>www.example.com/images/tag/num/num/num</li>
  </ul>
  
  <p>Would it not be easier (for future developers) and faster (to implement and learn) to map the url pattern /images to a servlet and have a line or two that parses the url for the parameters instead of learning, implementing and configuring one of these libraries to do it for you.</p>
  
  <ul>
  <li><a href="http://en.wikipedia.org/wiki/Apache_CXF" rel="noreferrer">Apache CXF</a></li>
  <li><a href="http://jersey.java.net/" rel="noreferrer">Jersey</a> (popular)</li>
  <li><a href="http://en.wikipedia.org/wiki/Restlet" rel="noreferrer">Restlet</a> (pioneer of JAX-RS)</li>
  <li><a href="http://www.jboss.org/resteasy" rel="noreferrer">RESTEasy</a></li>
  </ul>
  
  <p>Essentially what I am asking is... What is the value in using a RESTful Java framework? Would it not be adding a lot of complexity, in the implementation, for a simple problem?</p>
  
  <p>EDIT: This jersey code is handled very neatly and everyone should know how to do it in servlet form if they are looking into libraries to do it for them.</p>
  
  <pre><code>@Path("/helloworld")
  public class HelloWorldResource {
  
      // The Java method will process HTTP GET requests
      @GET
      // The Java method will produce content identified by the MIME Media
      // type "text/plain"
      @Produces("text/plain")
      public String helloWorld() {
          // Return some cliched textual content
          return "Hello World";
      }
  }
  </code></pre>
  
  <p>If all you are going to be doing is a "service" that returns text that is driven by URL parameters, so plain text returns, is a framework necessary?</p>