-3

which one is better for implementing restful architecture?

jax-rs example :

  @GET
  @Produces(MediaType.TEXT_XML)
  public String sayXMLHello() {
    return xmlHello();
  }  

servlet example :

    protected void doGet( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException
    {
        //showUsers( response);
    }

    

UPDATE:

I can't DELETE THIS QUESTION... Please do not give me a negative rating... thanks.

And so, I prefer to use servlet for implementing the restful... Because of making easy and flexible designs...

ultra.deep
  • 1,699
  • 1
  • 19
  • 23

1 Answers1

1

This decision is entirely up to you and is primarily matter of preference.

However, Jax-RS will provide utilities (via annotations) which lead to cleaner code when developing RESTful applications.

RamV13
  • 547
  • 4
  • 8