title: Spring Boot vs. Apache CXF for RESTful Web Services?
body: <p>I am part of a coding competition, the task is to create a RESTful online marketplace where users can post buy and sell requests via http. </p>
  
  <p>I need to build a front end web service that accepts and stores these requests. </p>
  
  <p>The tech requirements include both Spring boot and CXF. As far as I am aware, both CXF and Spring boot are capable of accepting http requests. </p>
  
  <p>In spring boot, you use a controller like:</p>
  
  <pre><code>@Controller
  @EnableAutoConfiguration
  public class controller {
  
      @RequestMapping("/")
      @ResponseBody
      String home() {
          return "Hello, World!";
      }
  }
  </code></pre>
  
  <p>Whereas with CXF (using javax.ws.rs), the code might look like this:</p>
  
  <pre><code>@WebService(serviceName = "MarketService", targetNamespace = "http://localhost:9005")
  @Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
  @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
  public interface MarketService {
  
      @GET
      @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
      @Produces({ MediaType.APPLICATION_JSON })
      @Path("/sells/{id}")
      public prod getProduct(@PathParam("id") int id);
  </code></pre>
  
  <p>Can someone help me understand the fundamental difference between these two approaches to handling http requests? Is there a way I can use both Spring Boot and CXF in the same application? </p>