Correction:

  Make that injection call @InjectObject("service:gtd.UserDataSource")

That's what I get for not just cutting and pasting! (It still fails as described)

 ...R

On Oct 31, 2005, at 17:59, Richard Clark wrote:

I'm experimenting with Tapestry 4 (not quite ready to apply this to the huge production app yet ;) ), and ran into an interesting problem.

I have a Validator that's used in my login process, and a service that gives access to the user names & passwords. I would like the validator to pick up the service itself, but it's not working right.

When I try:

public abstract LoginValidator implements Validator {

  @InjectObject(UserDataSource.class)
  public abstract UserDataSource getUserInfo();

  ...
}

I get an instantiation exception when trying to use the validator. But when I make this concrete (adding a private UserDataSource field and changing the above declaration to:

@InjectObject(UserDataSource.class)
  public UserDataSource getUserInfo() {
    return userInfo;
  }

  public void setUserInfo(UserDataSource info) {
    userInfo = info;
  }

userInfo is always null!

So, what's the trick to making this work? Will I always have to declare this in a <bean> element and set the user data source from the outside, or is there a way to keep it nicely self-contained?

 ...Richard



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to