0

I would like to have jaxrs endpoint in spring boot app. On the same server I would like to have html page that servers RichInternetApplication with single page.

Is such configuration is possible? I am trying, but it seems they work to exclude each other.

My mvn home controller:

@Controller
public class HomeContoller {
    @RequestMapping("/")
    public String index() {
        return "index";
    }
}

and jaxrs conf:

@Configuration
public class JerseyConfig extends ResourceConfig {

    public JerseyConfig() {
        // scan the resources package for our resources
        packages(getClass().getPackage().getName() + ".resources");
    }
}

And jaxrs endpoint

@Path("/") public interface Api {
    @GET @Path("ping") Response ping();
}

@Component
@Scope("request")
public class ApiController extends Application implements Api {
    @Override public Response ping() {
        return Response.ok("pong").build();
    }
}

If I would go with spring mvc instead of jaxrs it would work?

Please help

masterdany88
  • 5,041
  • 11
  • 58
  • 132

1 Answers1

0

You have to choose one implementation. You cannot get both.

https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-jersey

Emanuel Ramirez
  • 392
  • 2
  • 8