@SpringBean scope, where does it start-end?
Hello, I am trying to integrate BIRT into Spring-Wicket combo. *The case:* So far, I wrote a class that instantiates report engine and added spring annotations. I already have /context:component-scan base-package=blah.blah.andmoreblah // in bean definition file. Now I can access it via @SpringBean annotation in panels-webpages etc... but *The Intent:* I have some classes (that extends ByteArrayResource) that simply configures the report engine to produce desired report. *The Problem:* On the other hand in the class that extends ByteArrayResource the @SpringBean annotated instance comes *null*. Any insights? - www.mehmetatas.info -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/SpringBean-scope-where-does-it-start-end-tp4080069p4080069.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: @SpringBean scope, where does it start-end?
Only o.a.w.Component and o.a.w.Behavior (since 1.5.3) are auto injected. For anything else you need: class MyClass { @SpringBean private MyBean bean; public MyClass() { // my stuff Injector.get().inject(this); } } On Thu, Nov 17, 2011 at 4:04 PM, bilgisever mehmetate...@hotmail.com wrote: Hello, I am trying to integrate BIRT into Spring-Wicket combo. *The case:* So far, I wrote a class that instantiates report engine and added spring annotations. I already have /context:component-scan base-package=blah.blah.andmoreblah // in bean definition file. Now I can access it via @SpringBean annotation in panels-webpages etc... but *The Intent:* I have some classes (that extends ByteArrayResource) that simply configures the report engine to produce desired report. *The Problem:* On the other hand in the class that extends ByteArrayResource the @SpringBean annotated instance comes *null*. Any insights? - www.mehmetatas.info -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/SpringBean-scope-where-does-it-start-end-tp4080069p4080069.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: @SpringBean scope, where does it start-end?
in non component you can inject by Injector.get().inject(this) in constructor On Thu, Nov 17, 2011 at 7:34 PM, bilgisever mehmetate...@hotmail.com wrote: Hello, I am trying to integrate BIRT into Spring-Wicket combo. *The case:* So far, I wrote a class that instantiates report engine and added spring annotations. I already have /context:component-scan base-package=blah.blah.andmoreblah // in bean definition file. Now I can access it via @SpringBean annotation in panels-webpages etc... but *The Intent:* I have some classes (that extends ByteArrayResource) that simply configures the report engine to produce desired report. *The Problem:* On the other hand in the class that extends ByteArrayResource the @SpringBean annotated instance comes *null*. Any insights? - www.mehmetatas.info -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/SpringBean-scope-where-does-it-start-end-tp4080069p4080069.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org -- thank you, regards, Vineet Semwal - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: @SpringBean scope, where does it start-end?
SpringBean magic will only work for components. If you want to use for non-componet you have to explicitly call Injector.get().inject(this); for wicket 1.5.x or InjectorHolder.getInjector().inject(this); for wicket 1.4.x Ernesto On Thu, Nov 17, 2011 at 3:04 PM, bilgisever mehmetate...@hotmail.com wrote: Hello, I am trying to integrate BIRT into Spring-Wicket combo. *The case:* So far, I wrote a class that instantiates report engine and added spring annotations. I already have /context:component-scan base-package=blah.blah.andmoreblah // in bean definition file. Now I can access it via @SpringBean annotation in panels-webpages etc... but *The Intent:* I have some classes (that extends ByteArrayResource) that simply configures the report engine to produce desired report. *The Problem:* On the other hand in the class that extends ByteArrayResource the @SpringBean annotated instance comes *null*. Any insights? - www.mehmetatas.info -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/SpringBean-scope-where-does-it-start-end-tp4080069p4080069.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: @SpringBean scope, where does it start-end?
Thanks it worked like charm. - www.mehmetatas.info -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/SpringBean-scope-where-does-it-start-end-tp4080069p4080367.html Sent from the Users forum mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org