-
1. Re: Forcing call of conversational component method on event
gavin.king Apr 7, 2006 4:23 PM (in response to d1g)What does "every event/request related to that component" mean?
You mean, every time a component is used? In that case, use an interceptor.
I don't really understand. -
2. Re: Forcing call of conversational component method on event
mirko27 Apr 7, 2006 4:24 PM (in response to d1g)Basically you can do following and this gives you ability to choose, which pages you wan`t to enchance with this feature:
pages.xml
<page view-id"/somepage.jsp" action="#{component.method}" .../>
I would use this one because in my applications I usually define conversation timeot by node and action would not be so hard to add. -
3. Re: Forcing call of conversational component method on event
d1g Apr 7, 2006 5:40 PM (in response to d1g)Thanks mirko27. I'd forgotten the pages.xml file. This almost solves my problem except that the action gets called prior to the render response phase which is too late for me.
From section 3.3 of the Seam reference.This action method is called at the beginning of the render response phase, any time the page is about to be rendered.
If this action were called earlier (after restore view) then it would work for me. I guess this would no longer be an action though.
Gavin, once my component has been created, after @Create, there is no way for the component to do something on subsequent requests, where no action has been called. The component is not used if the view is just rendered with no action call.
To recap, I want to ensure a method in my component is called on every relevant request and view. I want a chance to change the state of the component and conversation.
I may be able to use a mix of an interceptor and the pagex.xml file. I'll go away and think about this. Perhaps I'll reconsider my design. Thanks for the help. -
4. Re: Forcing call of conversational component method on event
mirko27 Apr 7, 2006 6:03 PM (in response to d1g)Well, I thought your situation over and this really is a design of Filter. Interceptor need`s to be called and is not tied to view. Implement some simple Filter. It voles all your problems very easilly and causes minimal load (much less then seam figuring out what and where to do)