This content has been marked as final.
Show 2 replies
-
1. Re: How can I get instance from Bean?
wuhaixing.wuhaixing.gmail.com Jun 24, 2010 4:06 AM (in response to wuhaixing.wuhaixing.gmail.com)ConfigTarget:
@Model public class GalleryController { private @Inject Logger logger; private TreeNode root; private TreeNode selectedDocument; private @Configure String albumRoot; private @Configure Integer test; }
ConfigExtension:
public <X> void processInjectionTarget(@Observes ProcessInjectionTarget<X> pit) { final InjectionTarget<X> it = pit.getInjectionTarget(); InjectionTarget<X> wrapped = new InjectionTarget<X>() { @Override public void inject(X instance, CreationalContext<X> ctx) { it.inject(instance, ctx); for (Map.Entry<Field, Object> configuredValue : configuredValues.entrySet()) { try { configuredValue.getKey().set(instance, configuredValue.getValue()); } catch (Exception e) { e.printStackTrace(); } } } }
exception :
java.lang.IllegalArgumentException: Can not set java.lang.String field albumRoot to org.jboss.weld.extensions.log.LoggerProducerIs this a bug?
-
2. Re: How can I get instance from Bean?
pmuir Jul 21, 2010 8:25 AM (in response to wuhaixing.wuhaixing.gmail.com)Did you fix this, or still need help?