Cool!  (This new-fangled IOC stuff feels like black magic to someone who cut
his teeth on Tapestry 3.  Not to mention WebObjects in the previous
century.  Keep the faith, baby!)


On Wed, Dec 29, 2010 at 3:28 PM, Thiago H. de Paula Figueiredo <
thiag...@gmail.com> wrote:

> You don't even need the @InjectService or @Inject annotations for injection
> to be done in constructors of services.
>
> Naming your session state class Visit makes me 99% sure you were a Tapestry
> 4 or 3 user. :P
>
>
> On Wed, 29 Dec 2010 18:19:12 -0200, Bryan Lewis <jbryanle...@gmail.com>
> wrote:
>
>  Here's what's been working for us, constructor injecion.  (My syntax might
>> be a bit old and deprecated by now?)
>>
>>
>>    public Visit(@InjectService("Cookies") Cookies cookieService)
>>    {
>>        this.cookieService = cookieService;
>>    }
>>
>>    // Just to make sure I don't try to do 'new Visit()', hide this
>> constructor.
>>    private Visit()
>>    {
>>    }
>>
>>
>>
>>
>> On Wed, Dec 29, 2010 at 2:37 PM, Tim Koop <t...@timkoop.com> wrote:
>>
>>  I have a class I call UserDetails, which is a SessionState object.  I use
>>> it like this on a component page:
>>>   @SessionState
>>>   private UserDetails userDetails;
>>>
>>> However, in my UserDetails class I want to retrieve Cookies like this:
>>>   @Inject
>>>   private Cookies cookies;
>>>
>>> But I don't think you can inject Tapestry objects on a non-component or
>>> non-page object, can you?
>>>
>>> Any ideas?
>>>
>>> Thanks.
>>>
>>> --
>>> Tim Koop
>>> t...@timkoop.com <mailto:t...@timkoop.com>
>>> www.timkoop.com <http://www.timkoop.com>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>>
>>>
>>>
>
> --
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
> and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
> Coordenador e professor da Especialização em Engenharia de Software com
> Ênfase em Java da Faculdade Pitágoras
> http://www.arsmachina.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