ef-labs / vertx-jersey

Run jersey in vert.x
MIT License
150 stars 47 forks source link

JerseyHandler should be able to be used with JerseyServer/JerseyVerticle #40

Closed testn closed 8 years ago

testn commented 9 years ago

For example, I want to create a verticle to host static content and jersey REST endpoint at the same time. For that, I would wire JerseyHandler to vert.x web handler directly instead.

adrianluisgonzalez commented 8 years ago

I think there are two ways to achieve this:

  1. Let JerseyServer create the vert.x HttpServer and provide a setupHandler(Handler handler). You can then wrap the Jersey handler and provide your own routes.
  2. Create the HttpServer and routes in vert.x web as you normally would and provide the JerseyHandler for whatever route you want. To initialize the JerseyHandler you would need to follow similar steps used by the JerseyServer here.

Do either of those options work for you?

testn commented 8 years ago

Yeah (2) 's what I'm doing but the current initialization seems to be quite awkward with the injection of DefaultVertxContainer in order to create JerseyHandler and then later inject it via init method.

adrianluisgonzalez commented 8 years ago

See comment in #39