I am trying to get the RequestParamters to be injected into a Guice-powered class I'm using as a servlet. I'm running it with Jersey & embedded Jetty. I declare the class like this:
@Path("/my_url")
@RequestScoped
public class MyUrlServlet {
// try to inject the RequestParameters
@Inject
@RequestParameters
private final Map<String, String[]> reqParms;
...
}
And I get errors at runtime stating that:
1) No implementation for java.util.Map was bound.
while locating java.util.Map
for parameter 1 at com.nurloc.rest.account.LoginServlet.(MyUrlServlet.java:31)
at com.nurloc.startup.ServletMappingConfig$1.configureServlets(ServletMappingConfig.java:34)
The docs also state that if you use this in a singleton class you need to use a provider, which I'm not certain how to write. Is it a provider that provides a Map<String, String[]>? If so, I didn't have any luck there either.