You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by bilgisever <me...@hotmail.com> on 2011/11/17 15:04:05 UTC

@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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: @SpringBean scope, where does it start-end?

Posted by bilgisever <me...@hotmail.com>.
   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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: @SpringBean scope, where does it start-end?

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
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 <me...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: @SpringBean scope, where does it start-end?

Posted by vineet semwal <vi...@gmail.com>.
in non component you can inject by
Injector.get().inject(this) in constructor

On Thu, Nov 17, 2011 at 7:34 PM, bilgisever <me...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
thank you,

regards,
Vineet Semwal

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: @SpringBean scope, where does it start-end?

Posted by Martin Grigorov <mg...@apache.org>.
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 <me...@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org