You mean you do:
@RequestScoped
public class Foo {
private Response resp; // + setter
@Produces
public Response rep() { return resp; }
}
@Path("...")
public class MyRep {
@Inject Foo foo;
@GET
public Response someEndpoint() { Response resp = ...,
foo.setResp(resp); return resp; }
}
@Prodiver
public class Mapper implements ExceptionMapper<...> {
@Inject Instance<Response> reps;
...
}
?
It should work yes. Ensure setResp is called early enough and that the
producer is well scanned
Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau
2014-12-18 12:23 GMT+01:00 hwaastad <[email protected]>:
> Yeah,
> I see that it's OK in 1.7.2-snapshot.
>
> looking forward to 1.7.2 :-)
>
> another question:
> I've seen a couple og wildfly examples injecting an instance<Response> into
> a provider. (also having a producer somewhere).
>
> I have'nt really dug into it (will do) but I get a
> UnsatisfiedResolutionException. Any suggestions?
>
> br hw
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/ExceptionMapper-and-inject-tp4673237p4673239.html
> Sent from the TomEE Users mailing list archive at Nabble.com.