Toying around with Quarkus, I'm trying to get the ServletContext
injected in my application:
@Controller
@Path("/greeting/")
@RequestScoped
public class GreetingResource {
@Inject
ServletContext servletContext;
}
It compiles just fine, but in the packaging phase the quarkus-maven-plugin fails with:
[1] Unsatisfied dependency for type javax.servlet.ServletContext and qualifiers [@Default]
- java member: exampleapp.GreetingResource#servletContext
- declared on CLASS bean [types=[java.lang.Object, exampleapp.GreetingResource], qualifiers=[@Default, @Any], target=exampleapp.GreetingResource]
My app has a dependency on io.quarkus:quarkus-resteasy, which pulls in io.quarkus:quarkus-undertow, which in turn pulls in io.undertow:undertow-servlet.
I'd expect any of the Undertow-extensions to provide the injection of the ServletContext
, but apparently my assumption is wrong... Any ideas?