Sorry, but those annotations are only supported for pages and
components, not for beans or anything else.
However, it easy to define a HiveMind service, inject whats needed
into the service, and then inject that service into your page or
component.
On 10/31/05, Richard Clark <[EMAIL PROTECTED]> wrote:
> 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]
>
>
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]