On Tue, 18 Nov 2014 18:24:47 -0200, dragon <milim...@gmail.com> wrote:

@Contribute(WebSecurityManager.class)
    public static void addRealms(Configuration<Realm> configuration) {
CredentialsMatcher credentialsMatcher = new RCredentialsMatcher();
        RRealm realm = new RRealm();

As Harry said, you're instantiating RReal directly, so no injections are done. Tapestry-IoC can only do injections in objects it instantiated. He's first suggestiong would look like this:

public static void addRealms(Configuration<Realm> configuration, @Autobuild RRealm realm) { CredentialsMatcher credentialsMatcher = new RCredentialsMatcher();
         realm.setCredentialsMatcher(credentialsMatcher);
         configuration.add(realm);
}

You could also do this:

public static void addRealms(Configuration<Realm> configuration, ObjectLocator objectLocator) { CredentialsMatcher credentialsMatcher = new RCredentialsMatcher();
         RRealm realm = objectLocator.autobuild(RRealm.class);
         realm.setCredentialsMatcher(credentialsMatcher);
         configuration.add(realm);
}

When the realm is created any @Inject is ignored (Session is always
NULL).  I have looked at the tynamo page and I do not see where its
described or shown using the realm as a service.. am i missing something?

You should have been looking at the Tapestry-IoC documentation for information about services, not Tynamo's.

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to