title: Equivalent POST and GET from HttpServlet to REST
body: <p>I am trying to understand the equivalent way of mimicking HttpServlet to a Restful webservice.</p>
  
  <hr>
  
  <p>I have the following HttpServlet code :</p>
  
  <pre><code>public class Servlet extends HttpServlet {
  
     public void doPost(HttpServletRequest req, HttpServletResponse res) {
        String reqXml = req.getParameter("xmlrequest");
     }
  
     public void doGet(HttpServletRequest req, HttpServletResponse res) {
        String reqXml = req.getParameter("xmlrequest");
     }
  
  }
  </code></pre>
  
  <hr>
  
  <p>I am trying to do the equivalent way in REST.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@GET
  @Path("/getInfo")
  @Produces(MediaType.APPLICATION_XML)
  public Response getDetails(@Context HttpServletRequest request) {
      String xmlRequest = request.getParameter("xmlrequest");
  }
  
  
  
  @GET
  @Path("/getInfo")
  @Produces(MediaType.APPLICATION_XML)
  public Response getDetails(@FormParam("xmlrequest") String request) {
      String xmlRequest = request.getParameter("xmlrequest");
  }
  </code></pre>
  
  <hr>