voyent
Facelets/Icefaces + Spring's OpenSessionInViewFilter  XML
Forum Index -> General Help
Author Message
johnny

Joined: 12/Jan/2007 00:00:00
Messages: 32
Offline


Hi there,

I'm currently injecting service objects that make use of Spring's HibernateTemplate into my Managed Beans.

I'm now coming across the dreaded Hibernate LazyInitializationException because I'm accessing properties in my domain objects that need to be lazyLoaded but the original hibernate session is nowhere to be found!

Enter OpenSessionInViewFilter which is meant to make all these nasty ORM hassles go away.

My only problem is how do i set up my filter mappings for the OpenSessionInViewFilter?

I've tried mapping it to >*.iface< but that doesn't seem to be working.

Has anyone succesfully used the OpenSessionInViewFilter with Icefaces and if so would you please share your filter mapping with us?

Much appreciated
J
fernando.deleon@gmail.com

Joined: 14/Nov/2006 00:00:00
Messages: 34
Offline


Hi jony..

I have spring working correct

<filter>
<filter-name>sessionFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>

<filter-mapping>
<filter-name>sessionFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>sessionFilter</filter-name>
<url-pattern>*.jspx</url-pattern>
</filter-mapping>

try it like that..
and now that i think of...do i need *.iface?
not sure...
maybe i do..?!
try that...though...
maybe my stuff works cuz i dissabled lazyloading..

johnny

Joined: 12/Jan/2007 00:00:00
Messages: 32
Offline


Thanks fernando,

Just one question and i hope it's not a stupid one, but why do you have *.jsf mapped?

I'm using lazy loading and for some reason i can't get it right.

At the moment i have the filter mapped to >/*< but i still get the Hibernate owning Session is closed exception.

I'd especially like to hear from somebody who is using lazy loading as well.

Thanks
J
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team