Thank you, Richard, Are there any docs on what I can do in <construct>? Say, I want to obtain HttpRequest?
Alexander -----Original Message----- From: Richard Kirby [mailto:[EMAIL PROTECTED] Sent: 05 March 2007 14:44 To: Tapestry users Subject: Re: Trying to use StateObjectFactory... Hi Alexander, You need to define a service that you then reference in the invoke-factory: <service-point id="SecurityBeanFactory" interface="org.apache.tapestry.engine.state.StateObjectFactory"> <invoke-factory> <construct class="com.test.util.SecurityBeanFactory"> <!-- Any config you need here... --> </construct> </invoke-factory> </service-point> <contribution configuration-id="tapestry.state.ApplicationObjects"> <state-object name="security" scope="session". <invoke-factory object="service:SecurityBeanFactory" /> </state-object> </contribution> Cheers Richard Kolesnikov, Alexander GNI wrote: > 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]