IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

WM7 SP2 - JSF Lifecycle PhaseListener

  • 1.  WM7 SP2 - JSF Lifecycle PhaseListener

    Posted Wed June 06, 2007 02:38 PM

    Hi,

    I have created a phase listener for my portlet. It’s working, but it has a weird first behavior.

    When a view or a page loads for the very first time, according to JSF theory, it should go inside the RESTORE_VIEW phase first and then to the RENDER_RESPONSE phase. I tested this in a JSF application and it confirms this statement. When I use my phase listener class in a Webmethod portlet, the first time it loads, it only goes into the RENDER_RESPONSE phase without going inside the RESTORE_VIEW phase.

    I really don’t know why it does not go inside the RESTORE_VIEW phase the first time the page is being loaded. Any explications? clues or work around?

    Thanks,

    Paul


    #webMethods-BPMS
    #webMethods
    #MWS-CAF-Task-Engine


  • 2.  RE: WM7 SP2 - JSF Lifecycle PhaseListener

    Posted Tue July 10, 2007 01:26 PM

    In jsf 1.1 (which is what mws 7 uses), there are three lifecycle scenarios: non-faces request generates faces response, faces request generates faces response, and faces request generates non-faces response. The first scenario is what happens when you view a page for the first time. In this case, the lifecycle processing invokes only the final stage of the faces lifecycle, RENDER_RESPONSE.

    If you want to invoke some code at the very earliest point in the faces lifecycle, the best way to do it is have your phase listener listen for both RESTORE_VIEW and RENDER_RESPONSE beforePhase events, setting a flag in your RESTORE_VIEW processing so that when the RENDER_RESPONSE phase comes around, you’ll know whether or not you already did the processing.


    #webMethods-BPMS
    #MWS-CAF-Task-Engine
    #webMethods