On 5/5/06, Jason Carreira <[EMAIL PROTECTED]> wrote:
> I would think we'd want to support some explicit > notion of a "setup" phase > right before rendering, and a "cleanup" phase > afterwards. That way, you can > do things like open a Hibernate session and do a > query that's needed to > populate a table, then clean up the session > afterwards. (JSF makes this > possible with "before phase" and "after phase' event > listeners, while Shale > exposes these concepts directly as callbacks to the > prerender() and > destroy() methods on your backing bean if it > implements ViewController.) We can do this with interceptors. Since each phase will have it's own action, the interceptors will wrap the entire call from the portlet dispatcher... I don't think there's a way to do something like keep a Hibernate session open across the processAction() and render() calls, though.
The only way I can think of to do this would be an egregious hack using static variables or something ... not a good idea. But you could certainly use interceptors to keep one Hibernate session open for the processAction() part, and a different session open for the render() part. Indeed, because the latter would be read only you'd likely want to do this anyway so that any locks from the processing part would have been released a little earlier. Craig
> With this structure, the Action framework would > actually have two > controllers in a portlet environment ... one for the > processAction() part > and one for the render() part. In a webapp, it would > all be just one, > essentially concatenating the processing steps. We > would also want some > sort of environment-independent "action context" > object that was implemented > differently for the two environments, but that seems > likely to be desireable > anyway. > Or more... I think WebWork's support is one of the few to support the other portlet states like minimized. --------------------------------------------------------------------- Posted via Jive Forums http://forums.opensymphony.com/thread.jspa?threadID=29317&messageID=57318#57318 --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]