ICEfaces
  1. ICEfaces
  2. ICE-2667

Using *.jsp url mapping for navigate, lifecycle events init(), destroy() are not fired consistently; preprocess(), prerender() at all

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.1, 1.6.2
    • Fix Version/s: 1.8.2
    • Labels:
      None
    • Environment:
      Icefaces 1.6.2, Glassfish V2, Sun's JSF RI 1.2_04-b10-p01, Netbeans 6.0. Also tested with same results on Tomcat 6 and with Icefaces 1.6.1.

      Description

      When using Icefaces, the lifecycle events such as init(), destroy(), prerender(), preprocess() are not consistently called on request-scoped beans that come with Netbeans (e.g. inherited from AbstractPageBean).

      I attach two identical projects (see attachments to forum post http://www.icefaces.org/JForum/posts/list/7010.page) with and without Icefaces that demonstrate the problem. The project contains two pages - Page1 contains a button that takes user to Page2 and Page2 has a button that takes him back to Page1. Each event that fires writes a message to the server log. Let's look at the logs:

      TestJsf project is pure JSF (doesn't use Icefaces) generates correct sequence of events:

       -- original request to Page1
       Page1 constructor testjsf.Page1@1ae4426
       Page1 init() testjsf.Page1@1ae4426
       Page1 prerender() testjsf.Page1@1ae4426
       Page1 destroy() testjsf.Page1@1ae4426
       
       
       -- button on Page1 clicked
       Page1 constructor testjsf.Page1@9e3065
       Page1 init() testjsf.Page1@9e3065
       Page1 preprocess() testjsf.Page1@9e3065
       Page1 button action testjsf.Page1@9e3065
       Page2 constructor testjsf.Page2@710a3b
       Page2 init() testjsf.Page2@710a3b
       Page2 prerender() testjsf.Page2@710a3b
       Page1 destroy() testjsf.Page1@9e3065
       Page2 destroy() testjsf.Page2@710a3b
       
       -- button on Page2 clicked
       Page2 constructor testjsf.Page2@c47ee4
       Page2 init() testjsf.Page2@c47ee4
       Page2 preprocess() testjsf.Page2@c47ee4
       Page2 button action testjsf.Page2@c47ee4
       Page1 constructor testjsf.Page1@66da50
       Page1 init() testjsf.Page1@66da50
       Page1 prerender() testjsf.Page1@66da50
       Page1 destroy() testjsf.Page1@66da50
       Page2 destroy() testjsf.Page2@c47ee4
       
       -- button on Page1 clicked
       Page1 constructor testjsf.Page1@159bc95
       Page1 init() testjsf.Page1@159bc95
       Page1 preprocess() testjsf.Page1@159bc95
       Page1 button action testjsf.Page1@159bc95
       Page2 constructor testjsf.Page2@6be940
       Page2 init() testjsf.Page2@6be940
       Page2 prerender() testjsf.Page2@6be940
       Page1 destroy() testjsf.Page1@159bc95
       Page2 destroy() testjsf.Page2@6be940
       


      TestIcefaces project uses Icefaces instead of pure JSF. It swallows some of init() and corresponding destroy() events (this behavior is inconsistent - changes from one run to antother) and all preprocess() and prerender() events. Here is the log:


       -- original request to Page1
       Constructor() TestIcefaces.Page1@309a10
       init() TestIcefaces.Page1@309a10
       destroy() TestIcefaces.Page1@309a10
       
       -- button on Page1 clicked
       Constructor() TestIcefaces.Page1@196a21e
       button1_action() TestIcefaces.Page1@196a21e
       Constructor() TestIcefaces.Page2@1f3305e
       
       -- button on Page2 clicked
       Constructor() TestIcefaces.Page2@199f62e
       button1_action() TestIcefaces.Page2@199f62e
       Constructor() TestIcefaces.Page1@15bfd47
       
       -- button on Page1 clicked
       Constructor() TestIcefaces.Page1@17a7476
       button1_action() TestIcefaces.Page1@17a7476
       Constructor() TestIcefaces.Page2@3a3001
       
       -- button on Page2 clicked
       Constructor() TestIcefaces.Page2@1faa3c5
       button1_action() TestIcefaces.Page2@1faa3c5
       Constructor() TestIcefaces.Page1@15ebf0
       

        Issue Links

          Activity

          Hide
          Frank Ye added a comment -

          generic problem reassigned

          Show
          Frank Ye added a comment - generic problem reassigned
          Hide
          Ted Goddard added a comment -

          NetBeans projects make use of the following listener variants:

          com.sun.rave.web.ui.appbase.servlet.LifecycleListener
          com.sun.rave.web.ui.appbase.faces.ActionListenerImpl
          com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl

          The LifecycleListener receives Servlet-level events, such as for Session and Request attribute changes.

          The ActionListener receives JSF Action Events.

          The ViewHandler intercepts JSF rendering and execution to produce call the prerender() and preprocess() callbacks. Although JSF has an extension mechanism (decorator pattern) for ViewHandlers, generally different ViewHandlers will conflict and the resolution is to integrate the functionality of the different ViewHandlers. We will evaluate this approach for the rave ViewHandler (as well as decoration; it does work in some circumstances, but it is very sensitive to the order that the ViewHandlers are loaded). Further, the other two listeners (which should not present substantial complication on their own) require interaction with the rave ViewHandler.

          Frank, could you comment on how we already integrate with each of the three listeners?

          Show
          Ted Goddard added a comment - NetBeans projects make use of the following listener variants: com.sun.rave.web.ui.appbase.servlet.LifecycleListener com.sun.rave.web.ui.appbase.faces.ActionListenerImpl com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl The LifecycleListener receives Servlet-level events, such as for Session and Request attribute changes. The ActionListener receives JSF Action Events. The ViewHandler intercepts JSF rendering and execution to produce call the prerender() and preprocess() callbacks. Although JSF has an extension mechanism (decorator pattern) for ViewHandlers, generally different ViewHandlers will conflict and the resolution is to integrate the functionality of the different ViewHandlers. We will evaluate this approach for the rave ViewHandler (as well as decoration; it does work in some circumstances, but it is very sensitive to the order that the ViewHandlers are loaded). Further, the other two listeners (which should not present substantial complication on their own) require interaction with the rave ViewHandler. Frank, could you comment on how we already integrate with each of the three listeners?
          Hide
          Ted Goddard added a comment -

          (For each of the three listeners, please comment on the specific things we are currently doing.)

          Show
          Ted Goddard added a comment - (For each of the three listeners, please comment on the specific things we are currently doing.)
          Hide
          Frank Ye added a comment -

          Using Visual Web Project and NB 6.1, the following project is created:
          http://10.18.39.25:8888/svn/repo/tools/ide/netbeans/6.1/jsf12/samples/jira/2667

          From the logging, the following cases lifeCylce works as expected
          http://localhost:8080/2667/Page1.iface

          One case subject to discussion is that

          Using the jsp mapping (since Page flow in design time only works with jsp page)
          http://localhost:8080/2667/Page2.jsp

          Go to Page3.jsp

          LifeCycle in the above case need to be investigated further ...

          Show
          Frank Ye added a comment - Using Visual Web Project and NB 6.1, the following project is created: http://10.18.39.25:8888/svn/repo/tools/ide/netbeans/6.1/jsf12/samples/jira/2667 From the logging, the following cases lifeCylce works as expected http://localhost:8080/2667/Page1.iface One case subject to discussion is that Using the jsp mapping (since Page flow in design time only works with jsp page) http://localhost:8080/2667/Page2.jsp Go to Page3.jsp LifeCycle in the above case need to be investigated further ...
          Hide
          User Burferd added a comment -

          This issue appeared to have been, at least partially, addressed in NB6.1 and ICEfaces 1.7.1.
          However with NB6.5 and ICEfaces 1.7.2, it appears to have reappeared.

          It looks like the prerender() method is not being called when the page is navigated to.

          Show
          User Burferd added a comment - This issue appeared to have been, at least partially, addressed in NB6.1 and ICEfaces 1.7.1. However with NB6.5 and ICEfaces 1.7.2, it appears to have reappeared. It looks like the prerender() method is not being called when the page is navigated to.

            People

            • Assignee:
              Unassigned
              Reporter:
              Ilia K
            • Votes:
              7 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: