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 this one work? Toni Lyytikäinen wrote: > > 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 > configured to work with the interceptor stack in Struts 2 because it's so > heavily tied to Spring interfaces and concepts. > > On 7/9/07, panpan <[EMAIL PROTECTED]> wrote: >> >> >> 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: >> > >> > <web-app> >> > <filter> >> > <filter-name>OSIVFilter</filter-name> >> > <filter-class> >> > org.springframework.orm.hibernate3.support.OpenSessionInViewFilter >> > </filter-class> >> > </filter> >> > ... >> > <filter-mapping> >> > <filter-name>OSIVFilter</filter-name> >> > <url-pattern>/*</url-pattern> >> > </filter-mapping> >> > <filter-mapping> >> > <filter-name>struts2</filter-name> >> > <url-pattern>/*</url-pattern> >> > </filter-mapping> >> > <listener> >> > <listener-class>org.springframework.web.context.ContextLoaderListener >> > </listener-class> >> > </listener> >> > <context-param> >> > <param-name>contextConfigLocation</param-name> >> > <param-value>/WEB-INF/applicationContext*.xml</param-value> >> > </context-param> >> > .. >> > </web-app> >> > >> > Of course you also need to have your (Hibernate) SessionFactory set in >> > Spring's applicationContext-file. >> > >> > >> > On 7/9/07, panpan <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >> 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. >> >> >> >> I would appreciate any inputs. >> >> >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11503872 >> >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> >> >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11504395 >> Sent from the Struts - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > -- View this message in context: http://www.nabble.com/-S2--how-to-configure-Spring%27s-OpenViewInSessionInterceptor-for-struts2-tf4050042.html#a11505610 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]