Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread panpan
That's great! I got pretty clear pictures now. Thanks again cilquirm. cilquirm wrote: > > > > panpan wrote: >> >> The session is open, why do I need to reattach them? >> > > You wouldn't need to if you loaded and discarded your objects in a single > request, but let's say you have objects

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread cilquirm
panpan wrote: > > The session is open, why do I need to reattach them? > You wouldn't need to if you loaded and discarded your objects in a single request, but let's say you have objects that lived around longer than a single request ( i.e., a User object in your http session ). You might h

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread panpan
Cilquirm. That's really helpful! Thans a lot! I can understand the most part your post and I still have question for the last sentense. "For those that you do, reattach them early on, and watch your transaction boundaries. " The session is open, why do I need to reattach them? And could you ple

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread cilquirm
Assuming your S2 actions are 'pathed' differently ( i.e. s2 actions are mapped to .action , while s1 actions are mapped to .do ), then specifying the url pattern only for s2 actions ( /*.action ) will have the intended effect. As far as side effects go, it's really dependent on your application.

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread panpan
Thank you cilquirm. I think i'm a little bit confused and the filter is the one I needed. There is one thing which is unclear to me. If I only apply the filter to the new developed struts2 action, it will not affect the rest existed application(struts1), right? I saw there are some side effect of

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread cilquirm
I think you may be confusing Struts2 (S2) interceptors with Spring Interceptors. The two are not the same. S2 interceptors provide some "aop-like" functionality by allowing code to modify request processing in some fashion; however it's not truly based around an aop standard ( i.e. aopallliance )

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread panpan
Thank you very much Tony. I'll try to write my own interceptor. Toni Lyytikäinen wrote: > > I took a look at that, but it's not actually written for Struts but for > WebWork 2.x and the AroundInterceptor class it extends is not included in > Struts 2. I don't know what that page is doing in St

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen
I took a look at that, but it's not actually written for Struts but for WebWork 2.x and the AroundInterceptor class it extends is not included in Struts 2. I don't know what that page is doing in Struts documentation, since it won't even compile with vanilla Struts 2. On 7/9/07, panpan <[EMAIL PR

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread panpan
Thank you a lot! Toni. That answer cleared my question. Have you noticed there is Non-IoC version of OpenSessionInViewInterceptor in the Apache Struts 2 Documents. Please click the below link: http://struts.apache.org/2.x/docs/non-ioc-version-of-opensessioninviewinterceptor.html I don't know if

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen
Sorry, I must have read the post too quickly and assumed you were talking about the filter, because I haven't really seen a working OSIV interceptor for Struts 2. If you want to use an interceptor, you'll probably have to write one yourself for Struts 2. I don't think the one in Spring can be conf

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread panpan
Thank you Toni for your example. I'm just wondering about the OpenViewInSessionInterceptor. Don't know how to configure it in struts2. Thanks again! Toni Lyytikäinen wrote: > > I can't really say about Spring 1.2.8 because I've only ever used 2.0, but > here's what I did: > > in web.xml: >

Re: [S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread Toni Lyytikäinen
I can't really say about Spring 1.2.8 because I've only ever used 2.0, but here's what I did: in web.xml: OSIVFilter org.springframework.orm.hibernate3.support.OpenSessionInViewFilter ... OSIVFilter /* struts2 /* org.springframework.web.context.ContextLoaderListener contextC

[S2] how to configure Spring's OpenViewInSessionInterceptor for struts2

2007-07-09 Thread panpan
I'm new to Spring and Struts2 and currently working on an existing project(Spring 1.2.8+ struts+hibernate 3) which is upgrading to struts2. Need to add OpenViewInSessionInterceptor to the project to enalbe the lazy loaing in the presentation layor. I've searched the forum and didn't get the answer