Announcement Announcement Module
No announcement yet.
Container Hierarchy Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Container Hierarchy

    The integration of Webwork2 and PicoContainer (found in NanoContainer) creates a container hierarchy (Application, Session, Request).

    Actions are registered in the request container (a new container is created for every request) and therefore can have dependencies on components defined at all levels.

    I am not fully sure about the usefullness of the request container vs the potential overhead but I certainly find it usefull to have a container per session.

    Actions could be defined as prototypes in the session container (or automatically registered as beans with autowiring?). This allows to have singleton components per session and dependency resolving is done independently of the scope. I suppose this would involve a ServletContextListener to listen for session creation and expiration.

    Is it possible do that currently in Spring?
    Anyone tried to do something like this?


  • #2
    It wouldn't be hard to do. A listener or handler interceptor could create a new context whose parent was the application context. But why not use a strongly typed session object to hold whatever objects are required for the session? It would seem worrying if large numbers of objects were required to be held in a session...