You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Damir Bijuklic <da...@yahoo.com> on 2009/02/04 22:37:33 UTC

T5 - spring integration

Hi,

i would like to share some state objects between tapestry pages and spring controllers (mainly login data).
My naive first approach is to create session scoped object in spring and access it from both sides, unfortunately it is to naive...

In spring i use @Component and @Scope("session") annotations on state object.
In tapestry i use @Inject and @Service("sharedData") annotations.

When I try accesing object from tapestry side i get 

ComponentEventException Error creating bean with name 'scopedTarget.sharedData': Scope 'session' is not active for the current thread; 


What is recommended practice for sharing such data, if that is possible. I would like to avoid using external storage like database for various reasons including simplicity and performance.

I have read somewhere that T5.1 supports injecting tapestry objects into spring beans. Should I try that? 
I don't mind if it is still work in progress so the exact api might change a bit until it is final. 


PS
This is the first project I'm using T5 and as expected it is so much more fun than T4. 
I really love live class reloading, almost like coding in a scripting language but with access to all those refactorings.
Thank you Howard!


Damir


      

Re: T5 - spring integration

Posted by Francois Armand <fa...@linagora.com>.
Damir Bijuklic wrote:
> Hi,
>
> I have actually found a solution in Spring docs. You need to put spring RequestContextFilter before t5 filter, like this:
> [...]
>   

It would be great if you could add an HowTo for this discover, to let 
the other knows about that - I'm quite sur some other will thank you a 
lot for the pain saved ;)

-- 
Francois Armand
Etudes & Développements J2EE
Groupe Linagora - http://www.linagora.com
Tél.: +33 (0)1 58 18 68 28
-----------
http://fanf42.blogspot.com
InterLDAP - http://interldap.org 
FederID - http://www.federid.org/
Open Source identities management and federation


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


Re: T5 - spring integration

Posted by Damir Bijuklic <da...@yahoo.com>.
Hi,

I have actually found a solution in Spring docs. You need to put spring RequestContextFilter before t5 filter, like this:

  <filter>
    <filter-name>requestContextFilter</filter-name>
    <filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
  </filter>

  <filter-mapping>
    <filter-name>requestContextFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>


It is working now, so no JIRA issue needed.



________________________________
From: Howard Lewis Ship <hl...@gmail.com>
To: Tapestry users <us...@tapestry.apache.org>
Sent: Wednesday, 4 February, 2009 22:44:30
Subject: Re: T5 - spring integration

Scope 'session' is not active for the current thread

looks like a Spring exception; seems like its wanting some per-thread
setup.  That's easy enough to do, I just haven't used Spring @Scope
before and I didn't know about it. If you could add a JIRA Issue, with
pointers to the appropriate Spring documentation, I can take care of
that.

On Wed, Feb 4, 2009 at 1:37 PM, Damir Bijuklic <da...@yahoo.com> wrote:
> Hi,
>
> i would like to share some state objects between tapestry pages and spring controllers (mainly login data).
> My naive first approach is to create session scoped object in spring and access it from both sides, unfortunately it is to naive...
>
> In spring i use @Component and @Scope("session") annotations on state object.
> In tapestry i use @Inject and @Service("sharedData") annotations.
>
> When I try accesing object from tapestry side i get
>
> ComponentEventException Error creating bean with name 'scopedTarget.sharedData': Scope 'session' is not active for the current thread;
>
>
> What is recommended practice for sharing such data, if that is possible. I would like to avoid using external storage like database for various reasons including simplicity and performance.
>
> I have read somewhere that T5.1 supports injecting tapestry objects into spring beans. Should I try that?
> I don't mind if it is still work in progress so the exact api might change a bit until it is final.
>
>
> PS
> This is the first project I'm using T5 and as expected it is so much more fun than T4.
> I really love live class reloading, almost like coding in a scripting language but with access to all those refactorings.
> Thank you Howard!
>
>
> Damir
>
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


      

Re: T5 - spring integration

Posted by Howard Lewis Ship <hl...@gmail.com>.
Scope 'session' is not active for the current thread

looks like a Spring exception; seems like its wanting some per-thread
setup.  That's easy enough to do, I just haven't used Spring @Scope
before and I didn't know about it. If you could add a JIRA Issue, with
pointers to the appropriate Spring documentation, I can take care of
that.

On Wed, Feb 4, 2009 at 1:37 PM, Damir Bijuklic <da...@yahoo.com> wrote:
> Hi,
>
> i would like to share some state objects between tapestry pages and spring controllers (mainly login data).
> My naive first approach is to create session scoped object in spring and access it from both sides, unfortunately it is to naive...
>
> In spring i use @Component and @Scope("session") annotations on state object.
> In tapestry i use @Inject and @Service("sharedData") annotations.
>
> When I try accesing object from tapestry side i get
>
> ComponentEventException Error creating bean with name 'scopedTarget.sharedData': Scope 'session' is not active for the current thread;
>
>
> What is recommended practice for sharing such data, if that is possible. I would like to avoid using external storage like database for various reasons including simplicity and performance.
>
> I have read somewhere that T5.1 supports injecting tapestry objects into spring beans. Should I try that?
> I don't mind if it is still work in progress so the exact api might change a bit until it is final.
>
>
> PS
> This is the first project I'm using T5 and as expected it is so much more fun than T4.
> I really love live class reloading, almost like coding in a scripting language but with access to all those refactorings.
> Thank you Howard!
>
>
> Damir
>
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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