Thanks Cristi!

It works, and also I've found that it is usual way seeing the javadoc for : SpringComponentInjector
Cristi Manole пишет:
Hello,

Can you try adding this to the WebSession constructor (or before actually
using the bean) :

InjectorHolder.getInjector().inject(this);

I don't know if this is the usual way of doing things, but it works for me.

Cristi Manole

On Sat, Apr 18, 2009 at 11:28 AM, Khlystov Alexandr <[email protected]>wrote:

Hi all!

Qustion: how to setup the @SpringBean for the WebSession?

I am folowing this guide:
http://cwiki.apache.org/WICKET/spring.html#spring-us...@springbeanbeyondwicket

I have defined a simple bean:
...
 <bean name="navigationManager"
class="org.ovservice.hellowebapp.manager.NavigationManagerImpl">
  <property name="navigationDao">
    <ref bean="navigationDao" />
  </property>
 </bean>
...
and at WebApplication code:
...
  protected void init() {
      super.init();
      addComponentInstantiationListener(new SpringComponentInjector(this));
...

it works correctly for WebPage:
...
public class Left3ColumnPanel extends Panel{

  @SpringBean(name="navigationManager")
  private NavigationManager navigationManager;
...

but it doesn't work for session:
...
public class HelloWebappWebSession extends AuthenticatedWebSession{
...
  @SpringBean(name="navigationManager")
  private NavigationManager navigationManager;
...

I've got the

java.lang.NullPointerException
   at
org.ovservice.hellowebapp.web.HelloWebappWebSession.authenticate(HelloWebappWebSession.java:47)


How can I use beans in WebSession? and maybe in some classes which are not
the Wicket components.

Thanks in advance!



--
Khlystov Alexandr


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]





--
Khlystov Alexandr


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to