Thank you, Ben,

Now I ca see how it works.

Alexander

-----Original Message-----
From: Ben Dotte [mailto:[EMAIL PROTECTED] 
Sent: 05 March 2007 14:44
To: Tapestry users
Subject: RE: Trying to use StateObjectFactory...


Hi Alexander,

The way I have done this is to make the factory a service as well.

<contribution configuration-id="tapestry.state.ApplicationObjects">
        <state-object name="security" scope="session">
                <invoke-factory object="service:MyFactory"/>
        </state-object>
</contribution>

<service-point id="MyFactory"
interface="org.apache.tapestry.engine.state.StateObjectFactory">
        <invoke-factory>
                <construct class="com.test.util.SecurityBeanFactory" />
        </invoke-factory>
</service-point>

HTH

Ben

-----Original Message-----
From: Kolesnikov, Alexander GNI [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 05, 2007 6:34 AM
To: Tapestry users
Subject: Trying to use StateObjectFactory...

Hello everyone,

I am using Tapestry 4.0.2.

I want to use an ASO with some security information in it. The
information should be obtained from HttpRequest on the ASO's creation. I
decided to use a StateObjectFactory to create such an ASO and configured
it like this:

<contribution configuration-id="tapestry.state.ApplicationObjects">
        <state-object name="security" scope="session">
                <invoke-factory
object="com.test.util.SecurityBeanFactory"/>
        </state-object>
</contribution>

Then I am trying to obtain the ASO in the page's code like this:

@InjectState("security")
public abstract SecurityBean getSecurity();

The code for the factory was more sensible, but to find a problem I left
just this:

public class SecureBeanFactory implements StateObjectFactory {

        public Object createStateObject() {
                SecurityBean sb = new SecurityBean(new TestUser(), new
TestApplication());
                return sb;
        }
}

However, I am getting an exception:

org.apache.hivemind.ApplicationRuntimeException 

Unable to construct configuration tapestry.state.ApplicationObjects:
Error: Object provider selector 'com.test.util.SecurityBeanFactory' is
not properly formatted. 

What can be wrong here?

Thanks,

Alexander

------------------------------------------------------------------------
------
CONFIDENTIALITY NOTICE: If you have received this email in error, please
immediately notify the sender by e-mail at the address shown.  This
email transmission may contain confidential information.  This
information is intended only for the use of the individual(s) or entity
to whom it is intended even if addressed incorrectly.  Please delete it
from your files if you are not the intended recipient.  Thank you for
your compliance.  Copyright 2007 CIGNA
========================================================================
======

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



------------------------------------------------------------------------------
CONFIDENTIALITY NOTICE: If you have received this email in error, please 
immediately notify the sender by e-mail at the address shown.  This email 
transmission may contain confidential information.  This information is 
intended only for the use of the individual(s) or entity to whom it is intended 
even if addressed incorrectly.  Please delete it from your files if you are not 
the intended recipient.  Thank you for your compliance.  Copyright 2007 CIGNA
==============================================================================


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

Reply via email to