title: How to used "web request by spring mvc" and "rest by jersey" in spring boot
body: <p>Hi i want to handle web request by spring mvc and handle rest by jersey
  in the same project (Spring-Boot)</p>
  
  <p>As i test Rest service is working but web is not
  How can i set Application Config ?</p>
  
  <pre><code>@SpringBootApplication
  @EnableAutoConfiguration
  @ComponentScan(basePackageClasses = {ProductsResource.class, MessageService.class,Web.class})
  public class MyApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(MyApplication.class, args);
      }
  
      @Bean
      public ServletRegistrationBean jerseyServlet() {
          ServletRegistrationBean registration = new ServletRegistrationBean(new ServletContainer(), "/rest/*");
          registration.addInitParameter(ServletProperties.JAXRS_APPLICATION_CLASS, JerseyInitialization.class.getName());
          return registration;
      }
  
  
      @Bean
      public ServletRegistrationBean webMVC() {
          DispatcherServlet dispatcherServlet = new DispatcherServlet();
  
          AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
          applicationContext.register(ResourceConfig.class);
          dispatcherServlet.setApplicationContext(applicationContext);
  
          ServletRegistrationBean servletRegistrationBean = new ServletRegistrationBean(dispatcherServlet, "*.html");
          servletRegistrationBean.setName("web-mvc");
          return servletRegistrationBean;
      }
  </code></pre>
  
  <p>Web Controller</p>
  
  <pre><code>@Controller
  @Component
  public class Web {
  
      @RequestMapping("/foo")
      String foo() {
          return "foo";
      }
  
      @RequestMapping("/bar")
      String bar() {
          return "bar";
      }
  
  }
  </code></pre>
  
  <p>Rest Controller</p>
  
  <pre><code>@Path("/")
  @Component
  public class ProductsResource {
  
      @GET
      @Produces(MediaType.APPLICATION_JSON)
      @Path("/hello")
      public String hello() {
          return "Hello World";
      }
  }
  </code></pre>