Re: T5 - spring integration
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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: T5 - spring integration
Hi, I have actually found a solution in Spring docs. You need to put spring RequestContextFilter before t5 filter, like this: requestContextFilter org.springframework.web.filter.RequestContextFilter requestContextFilter /* It is working now, so no JIRA issue needed. From: Howard Lewis Ship To: Tapestry users 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 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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
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 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-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
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 question
I'm just taking a guess here, but I think it won't. As far as I know the tapestry spring integration was always limited to singleton beans. I think the "prototype" variant is maybe difficult to handle since tapestry ioc (and hivemind in the past) have a somewhat different approach on object creation, using pooling and all, afaik. I never really considered that a big drawback, though. Plus, apparently you can just inject the application context and get your prototype beans from there. See http://tapestry.apache.org/tapestry5/tapestry-spring/ , last sentence. Hth, Lutz On Sun, Sep 14, 2008 at 6:17 PM, <[EMAIL PROTECTED]> wrote: > Hi, > > I noticed in the documentation that non-singleton beans are not handled > properly, will this be fixed before the official release of T5? > > Regards, > Amir > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5 Spring Integration
The documentation for the spring module at http://tapestry.apache.org/tapestry5/tapestry-spring/ should mention that the applications pom.xml needs this dependency declaration: org.apache.tapestry tapestry-spring ${tapestry-release-version} -- View this message in context: http://www.nabble.com/T5-Spring-Integration-tf3936038.html#a11163280 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration Issue
As I mentioned, my Spring configurations is confirmed as working. I was using 5.0.3 which I assumed was the latest as it's the one mentioned on the first page as the most recent SNAPSHOT. What's the best way to keep track of the latest available SNAPSHOT? A big "Thanks" to everyone who took the time to answer my original question. -Matt On 4/24/07, SergeEby <[EMAIL PROTECTED]> wrote: Hi, There is a new syntax with 5.0.4-SNAPSHOT and the URL http://tapestry.apache.org/tapestry5/tapestry-spring/ was updated a while ago. There is no more @Inject("spring:yourBean"). It works fine for me. Here is an excerpt: public class UserView { @Inject @SpringBean("userManager") private UserManager _userManager; public List getAllUsers() { return _userManager.getAllUsers(); } } The error seems to indicate a problem with your spring configuration. /Serge Nick Westgate wrote: > > Hmm, I'm not sure which way the docs are out of sync - future or past. > http://tapestry.apache.org/tapestry5/tapestry-spring/ > > You'll see further down the page after the example it mentions > "Spring:UserDAO". > That's what I'm using with 5.0.3 SNAPSHOT and it works. Try > > @Inject("spring:groupRepository") > private GroupRepository groupRepository; > > Cheers, > Nick. > > > Matt Welch wrote: >> I'm sure I must be doing something wrong, but for lthe life of me, I >> can't >> figure out what it is. >> >> I'm not trying anything complicated. I've confirmed that my Spring beans >> are >> accessible in my webapp so I know the Spring part of my configuration is >> correct. Here's how I'm trying to inject the Spring bean (per the >> tapestry-spring documentation): >> >>@Inject >>@SpringBean("groupRepository") >>private GroupRepository groupRepository; >> >> >> However, when I try to access the page that uses this service, I'm seeing >> the following error: >> >> java.lang.RuntimeException: No service implements the interface >> net.xxx.xxx.repository.GroupRepository. >> >> I'm clearly missing a configuration step, but I'm just not sure what it >> is. >> Any help would be greatly appreciated. >> >> -Matt >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5%3A-Spring-Integration-Issue-tf3636078.html#a10159940 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration Issue
Hi, There is a new syntax with 5.0.4-SNAPSHOT and the URL http://tapestry.apache.org/tapestry5/tapestry-spring/ was updated a while ago. There is no more @Inject("spring:yourBean"). It works fine for me. Here is an excerpt: public class UserView { @Inject @SpringBean("userManager") private UserManager _userManager; public List getAllUsers() { return _userManager.getAllUsers(); } } The error seems to indicate a problem with your spring configuration. /Serge Nick Westgate wrote: > > Hmm, I'm not sure which way the docs are out of sync - future or past. > http://tapestry.apache.org/tapestry5/tapestry-spring/ > > You'll see further down the page after the example it mentions > "Spring:UserDAO". > That's what I'm using with 5.0.3 SNAPSHOT and it works. Try > > @Inject("spring:groupRepository") > private GroupRepository groupRepository; > > Cheers, > Nick. > > > Matt Welch wrote: >> I'm sure I must be doing something wrong, but for lthe life of me, I >> can't >> figure out what it is. >> >> I'm not trying anything complicated. I've confirmed that my Spring beans >> are >> accessible in my webapp so I know the Spring part of my configuration is >> correct. Here's how I'm trying to inject the Spring bean (per the >> tapestry-spring documentation): >> >>@Inject >>@SpringBean("groupRepository") >>private GroupRepository groupRepository; >> >> >> However, when I try to access the page that uses this service, I'm seeing >> the following error: >> >> java.lang.RuntimeException: No service implements the interface >> net.xxx.xxx.repository.GroupRepository. >> >> I'm clearly missing a configuration step, but I'm just not sure what it >> is. >> Any help would be greatly appreciated. >> >> -Matt >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/T5%3A-Spring-Integration-Issue-tf3636078.html#a10159940 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration Issue
If you develop base on Tapestry 5.0.3 Please use @Inject("Spring:groupRepository") Instead of @Inject @SpringBean("groupRepository") 'groupRepository' is just your the bean id defined in your spring's configuration file. This is my first to answer question in mail list 2007/4/24, Matt Welch < [EMAIL PROTECTED]>: I'm sure I must be doing something wrong, but for lthe life of me, I can't figure out what it is. I'm not trying anything complicated. I've confirmed that my Spring beans are accessible in my webapp so I know the Spring part of my configuration is correct. Here's how I'm trying to inject the Spring bean (per the tapestry-spring documentation): @Inject @SpringBean("groupRepository") private GroupRepository groupRepository; However, when I try to access the page that uses this service, I'm seeing the following error: java.lang.RuntimeException: No service implements the interface net.xxx.xxx.repository.GroupRepository . I'm clearly missing a configuration step, but I'm just not sure what it is. Any help would be greatly appreciated. -Matt
Re: T5: Spring Integration Issue
On 4/24/07, Matt Welch <[EMAIL PROTECTED]> wrote: I'm sure I must be doing something wrong, but for lthe life of me, I can't figure out what it is. I'm not trying anything complicated. I've confirmed that my Spring beans are accessible in my webapp so I know the Spring part of my configuration is correct. Here's how I'm trying to inject the Spring bean (per the tapestry-spring documentation): @Inject @SpringBean("groupRepository") private GroupRepository groupRepository; This is from 5.0.4-SNAPSHOT and on, for early version use the one other has suggested. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration Issue
If you develop base on Tapestry 5.0.3 Please use @Inject("Spring:groupRepository") Instead of @Inject @SpringBean("groupRepository") 'groupRepository' is just your the bean id defined in your spring's configuration file. This is my first to answer question in mail list . I have never used mail list of any project before:) My name is Allen Guo , come from China 2007/4/24, Matt Welch <[EMAIL PROTECTED]>: I'm sure I must be doing something wrong, but for lthe life of me, I can't figure out what it is. I'm not trying anything complicated. I've confirmed that my Spring beans are accessible in my webapp so I know the Spring part of my configuration is correct. Here's how I'm trying to inject the Spring bean (per the tapestry-spring documentation): @Inject @SpringBean("groupRepository") private GroupRepository groupRepository; However, when I try to access the page that uses this service, I'm seeing the following error: java.lang.RuntimeException: No service implements the interface net.xxx.xxx.repository.GroupRepository. I'm clearly missing a configuration step, but I'm just not sure what it is. Any help would be greatly appreciated. -Matt
Re: T5: Spring Integration Issue
Hmm, I'm not sure which way the docs are out of sync - future or past. http://tapestry.apache.org/tapestry5/tapestry-spring/ You'll see further down the page after the example it mentions "Spring:UserDAO". That's what I'm using with 5.0.3 SNAPSHOT and it works. Try @Inject("spring:groupRepository") private GroupRepository groupRepository; Cheers, Nick. Matt Welch wrote: I'm sure I must be doing something wrong, but for lthe life of me, I can't figure out what it is. I'm not trying anything complicated. I've confirmed that my Spring beans are accessible in my webapp so I know the Spring part of my configuration is correct. Here's how I'm trying to inject the Spring bean (per the tapestry-spring documentation): @Inject @SpringBean("groupRepository") private GroupRepository groupRepository; However, when I try to access the page that uses this service, I'm seeing the following error: java.lang.RuntimeException: No service implements the interface net.xxx.xxx.repository.GroupRepository. I'm clearly missing a configuration step, but I'm just not sure what it is. Any help would be greatly appreciated. -Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Spring Integration Issue
I'm sure I must be doing something wrong, but for lthe life of me, I can't figure out what it is. I'm not trying anything complicated. I've confirmed that my Spring beans are accessible in my webapp so I know the Spring part of my configuration is correct. Here's how I'm trying to inject the Spring bean (per the tapestry-spring documentation): @Inject @SpringBean("groupRepository") private GroupRepository groupRepository; However, when I try to access the page that uses this service, I'm seeing the following error: java.lang.RuntimeException: No service implements the interface net.xxx.xxx.repository.GroupRepository. I'm clearly missing a configuration step, but I'm just not sure what it is. Any help would be greatly appreciated. -Matt
Re: T5: Spring Integration
On 2/19/07, Howard Lewis Ship <[EMAIL PROTECTED]> wrote: Yep, and all of this stuff will be rolled into a tapestry-spring Maven archetype. The tapestry-spring-integration module will support @Inject("spring:bean") to allow access to anything in the Spring bean context. I've already done the same thing for hivemind, using the hivemind: prefix, it would only take small amount of time to convert this to spring. I'll post these as JIRA issues. -- Massimo http://meridio.blogspot.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration
Yep, and all of this stuff will be rolled into a tapestry-spring Maven archetype. The tapestry-spring-integration module will support @Inject("spring:bean") to allow access to anything in the Spring bean context. On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote: Good catch :-) You also have to add the following line to your web.xml: org.springframework.web.context.ContextLoaderListener On 2/19/07, James Carman <[EMAIL PROTECTED]> wrote: > > Of course, you have to set up the ContextLoaderListener, right? > > > On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote: > > You can just inject the following into your pages: > > > > @Inject > > private ApplicationGlobals globals; > > > > And then use the servlet context inside the globals object to get the > > application context via > > > > WebApplicationContextUtils.getRequiredWebApplicationContext > > (servletContext); > > > > Once you have the application context, you just call getBean(String) to > get > > your managed beans. > > > > > > > > On 2/19/07, SergeEby <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, > > > > > > I know Spring integration will be included later in T5, but was > wondering > > > if > > > someone has already figured out how to do that. > > > I am playing around converting an existing application to T5. > > > > > > Thanks, > > > > > > /Serge > > > -- > > > View this message in context: > > > http://www.nabble.com/T5%3A-Spring-Integration-tf3253045.html#a9042869 > > > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Howard M. Lewis Ship TWD Consulting, Inc. Independent J2EE / Open-Source Java Consultant Creator and PMC Chair, Apache Tapestry Creator, Apache HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration
I think what is needed, though, is something that allows you to bind spring beans directly into your page/components. Having to lookup spring beans all the time can be a pain. On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote: Good catch :-) You also have to add the following line to your web.xml: org.springframework.web.context.ContextLoaderListener On 2/19/07, James Carman <[EMAIL PROTECTED]> wrote: > > Of course, you have to set up the ContextLoaderListener, right? > > > On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote: > > You can just inject the following into your pages: > > > > @Inject > > private ApplicationGlobals globals; > > > > And then use the servlet context inside the globals object to get the > > application context via > > > > WebApplicationContextUtils.getRequiredWebApplicationContext > > (servletContext); > > > > Once you have the application context, you just call getBean(String) to > get > > your managed beans. > > > > > > > > On 2/19/07, SergeEby <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hi, > > > > > > I know Spring integration will be included later in T5, but was > wondering > > > if > > > someone has already figured out how to do that. > > > I am playing around converting an existing application to T5. > > > > > > Thanks, > > > > > > /Serge > > > -- > > > View this message in context: > > > http://www.nabble.com/T5%3A-Spring-Integration-tf3253045.html#a9042869 > > > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration
Good catch :-) You also have to add the following line to your web.xml: org.springframework.web.context.ContextLoaderListener On 2/19/07, James Carman <[EMAIL PROTECTED]> wrote: Of course, you have to set up the ContextLoaderListener, right? On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote: > You can just inject the following into your pages: > > @Inject > private ApplicationGlobals globals; > > And then use the servlet context inside the globals object to get the > application context via > > WebApplicationContextUtils.getRequiredWebApplicationContext > (servletContext); > > Once you have the application context, you just call getBean(String) to get > your managed beans. > > > > On 2/19/07, SergeEby <[EMAIL PROTECTED]> wrote: > > > > > > Hi, > > > > I know Spring integration will be included later in T5, but was wondering > > if > > someone has already figured out how to do that. > > I am playing around converting an existing application to T5. > > > > Thanks, > > > > /Serge > > -- > > View this message in context: > > http://www.nabble.com/T5%3A-Spring-Integration-tf3253045.html#a9042869 > > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration
Of course, you have to set up the ContextLoaderListener, right? On 2/19/07, D&J Gredler <[EMAIL PROTECTED]> wrote: You can just inject the following into your pages: @Inject private ApplicationGlobals globals; And then use the servlet context inside the globals object to get the application context via WebApplicationContextUtils.getRequiredWebApplicationContext (servletContext); Once you have the application context, you just call getBean(String) to get your managed beans. On 2/19/07, SergeEby <[EMAIL PROTECTED]> wrote: > > > Hi, > > I know Spring integration will be included later in T5, but was wondering > if > someone has already figured out how to do that. > I am playing around converting an existing application to T5. > > Thanks, > > /Serge > -- > View this message in context: > http://www.nabble.com/T5%3A-Spring-Integration-tf3253045.html#a9042869 > Sent from the Tapestry - User mailing list archive at Nabble.com. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: T5: Spring Integration
You can just inject the following into your pages: @Inject private ApplicationGlobals globals; And then use the servlet context inside the globals object to get the application context via WebApplicationContextUtils.getRequiredWebApplicationContext (servletContext); Once you have the application context, you just call getBean(String) to get your managed beans. On 2/19/07, SergeEby <[EMAIL PROTECTED]> wrote: Hi, I know Spring integration will be included later in T5, but was wondering if someone has already figured out how to do that. I am playing around converting an existing application to T5. Thanks, /Serge -- View this message in context: http://www.nabble.com/T5%3A-Spring-Integration-tf3253045.html#a9042869 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5: Spring Integration
Hi, I know Spring integration will be included later in T5, but was wondering if someone has already figured out how to do that. I am playing around converting an existing application to T5. Thanks, /Serge -- View this message in context: http://www.nabble.com/T5%3A-Spring-Integration-tf3253045.html#a9042869 Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]