koert
Dec 11th, 2006, 07:24 AM
In the JSF/facelets application I am developing, I use several session scoped beans in which I want to use a reference to a (non-serializable) service that is injected with the JSF-Spring variable resolver. Officially, your session scoped bean should be serializable so that the web container can serialize/deserialize this bean without any problems. Because the injected service is not serializable, this will not work. You may get away with ignoring the serializable requirements, but that may cause enormous problems when the application gets a lot of traffic.
I thought about creating a solution with a proxy that holds a transient reference to the service and restores the reference by looking it up in the application context.
Here is the gist of my solution. (http://w.kazed.net:8080/nowhere/space/spring/SerializableReference)
While doing this, I wondered if a similar solution already exists or how other people get around this problem.
I thought about creating a solution with a proxy that holds a transient reference to the service and restores the reference by looking it up in the application context.
Here is the gist of my solution. (http://w.kazed.net:8080/nowhere/space/spring/SerializableReference)
While doing this, I wondered if a similar solution already exists or how other people get around this problem.