I follow Weld doc
in section 4.11. InjectionPoint Object
There is a very interesting example of how to get the http parameter using CDI
but I copied the code in netbeans, everything compiles, but has a deployment error
Called: org.jboss.weld.exceptions.DeploymentException: WELD-001408 The injection point has unsatisfied dependencies. Injection point: parameter 1 java.lang.String com.test.HttpParamProducer.getParamValue (javax.enterprise.inject.spi.InjectionPoint, javax.servlet.ServletRequest); Qualifiers: [@ javax.enterprise.inject.Default ()]
How to solve this problem???
public class HttpParamProducer { @HttpParam("") @Produces String getParamValue( InjectionPoint ip, ServletRequest request) { return request.getParameter(ip.getAnnotated().getAnnotation(HttpParam.class).value()); } }
source share