ICEfaces
  1. ICEfaces
  2. ICE-3979

Co-existence with JSF 2.0 for ICEfaces 1.8.x

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.2, 1.8.2-EE-GA
    • Fix Version/s: 1.8.2-EE-GA_P01, 1.8.2a
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      GlassFish v3, JSF 2.0.0 PR

      Description

      It is useful for the current builds of ICEfaces to support JSF 2.0 to support experimentation and and investigation.

      Note that the technique for supporting the current JSF 2.0.0 PR release is likely very different from the technique for fully integrating ICEfaces 2.0 with JSF 2.0.

      Two main barriers to integrating ICEfaces 1.8 with JSF 2.0 present themselves:
        1. the FacesContext API has changed and now contains methods that return JSF 2.0 types
        2. the Facelets implementation is now built into JSF 2.0

      1. can be resolved by instantiating the appropriate class at runtime. 2. requires further investigation, but can be dealt with my not using Facelets initially.



        Activity

        Hide
        Ted Goddard added a comment -

        Disable gen.facelets.file as follows in component/build.xml:

        • <target name="jar.components" depends="gen.facelets.file, test">
          + <target name="jar.components" depends=" test">
        Show
        Ted Goddard added a comment - Disable gen.facelets.file as follows in component/build.xml: <target name="jar.components" depends="gen.facelets.file, test"> + <target name="jar.components" depends=" test">
        Hide
        Ted Goddard added a comment -

        This has been updated to include a wrapper for ExternalContext. This is necessary because of the addition of (among other methods) to the ExternalContext API:

        public Flash getFlash()

        auctionMonitor deploys and renders, but fails with the following exception upon interaction:

        Caused by: java.lang.NullPointerException
        at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:414)
        at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:153)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:124)
        at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:103)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
        at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:19)

        The workaround for this is to modify the actions so that they return the actual viewID:

        Index: src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionMonitorItemBean.java
        ===================================================================
        — src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionMonitorItemBean.java (revision 18928)
        +++ src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionMonitorItemBean.java (working copy)
        @@ -74,7 +74,7 @@
        "./images/time_left_hours.gif";
        private static final String TRIANGLE_OPEN = "./images/triangle_open.gif";
        private static final String TRIANGLE_CLOSED = "./images/triangle_close.gif";

        • private static final String SUCCESS = "success";
          + private static final String SUCCESS = "auctionMonitor.iface";

        private static final String STYLE_CLASS_EXPANDED_ROW = "rowClassHilite";

        Index: src/com/icesoft/applications/faces/auctionMonitor/beans/UserBean.java
        ===================================================================
        — src/com/icesoft/applications/faces/auctionMonitor/beans/UserBean.java (revision 18928)
        +++ src/com/icesoft/applications/faces/auctionMonitor/beans/UserBean.java (working copy)
        @@ -351,7 +351,7 @@
        position--;
        }

        • return ("moveUpMinor");
          + return ("auctionMonitor.iface");
          }

        /**
        @@ -365,7 +365,7 @@
        position++;
        }

        • return ("moveDownMinor");
          + return ("auctionMonitor.iface");
          }

        /**
        @@ -378,7 +378,7 @@
        position = (NUM_MESSAGES - 1);
        }

        • return ("moveToTop");
          + return ("auctionMonitor.iface");
          }

        /**
        @@ -389,7 +389,7 @@
        public String moveToBottom()

        { position = bottom(); - return ("moveToBottom"); + return ("auctionMonitor.iface"); }

        /**
        @@ -408,7 +408,7 @@
        position = bottom();
        }

        • return ("switchMinimized");
          + return ("auctionMonitor.iface");
          }

        /**
        Index: src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionBean.java
        ===================================================================
        — src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionBean.java (revision 18928)
        +++ src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionBean.java (working copy)
        @@ -56,7 +56,7 @@
        private static Log log = LogFactory.getLog(AuctionBean.class);
        private static int userCount = 0;
        public static final String RENDERER_NAME = "demand";

        • private static final String SUCCESS = "success";
          + private static final String SUCCESS = "auctionMonitor.iface";
          private String queryItemID;
          private String queryString;
          private AuctionMonitorItemBean[] searchItemBeans;
          Index: web/auctionMonitor.jspx
          ===================================================================
            • web/auctionMonitor.jspx (revision 18928)
              +++ web/auctionMonitor.jspx (working copy)
              @@ -324,7 +324,7 @@
              title="Enter your message text"
              styleClass="textField"/>
              <ice:commandButton id="button_send_message"
        • value="Send Message" action="send"
          + value="Send Message" action="auctionMonitor.iface"
          styleClass="orangeButtons"
          title="Send your message text"/>
          </ice:column>
        Show
        Ted Goddard added a comment - This has been updated to include a wrapper for ExternalContext. This is necessary because of the addition of (among other methods) to the ExternalContext API: public Flash getFlash() auctionMonitor deploys and renders, but fails with the following exception upon interaction: Caused by: java.lang.NullPointerException at com.icesoft.faces.application.D2DViewHandler.renderResponse(D2DViewHandler.java:414) at com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:153) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:124) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:103) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) at com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:19) The workaround for this is to modify the actions so that they return the actual viewID: Index: src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionMonitorItemBean.java =================================================================== — src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionMonitorItemBean.java (revision 18928) +++ src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionMonitorItemBean.java (working copy) @@ -74,7 +74,7 @@ "./images/time_left_hours.gif"; private static final String TRIANGLE_OPEN = "./images/triangle_open.gif"; private static final String TRIANGLE_CLOSED = "./images/triangle_close.gif"; private static final String SUCCESS = "success"; + private static final String SUCCESS = "auctionMonitor.iface"; private static final String STYLE_CLASS_EXPANDED_ROW = "rowClassHilite"; Index: src/com/icesoft/applications/faces/auctionMonitor/beans/UserBean.java =================================================================== — src/com/icesoft/applications/faces/auctionMonitor/beans/UserBean.java (revision 18928) +++ src/com/icesoft/applications/faces/auctionMonitor/beans/UserBean.java (working copy) @@ -351,7 +351,7 @@ position--; } return ("moveUpMinor"); + return ("auctionMonitor.iface"); } /** @@ -365,7 +365,7 @@ position++; } return ("moveDownMinor"); + return ("auctionMonitor.iface"); } /** @@ -378,7 +378,7 @@ position = (NUM_MESSAGES - 1); } return ("moveToTop"); + return ("auctionMonitor.iface"); } /** @@ -389,7 +389,7 @@ public String moveToBottom() { position = bottom(); - return ("moveToBottom"); + return ("auctionMonitor.iface"); } /** @@ -408,7 +408,7 @@ position = bottom(); } return ("switchMinimized"); + return ("auctionMonitor.iface"); } /** Index: src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionBean.java =================================================================== — src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionBean.java (revision 18928) +++ src/com/icesoft/applications/faces/auctionMonitor/beans/AuctionBean.java (working copy) @@ -56,7 +56,7 @@ private static Log log = LogFactory.getLog(AuctionBean.class); private static int userCount = 0; public static final String RENDERER_NAME = "demand"; private static final String SUCCESS = "success"; + private static final String SUCCESS = "auctionMonitor.iface"; private String queryItemID; private String queryString; private AuctionMonitorItemBean[] searchItemBeans; Index: web/auctionMonitor.jspx =================================================================== web/auctionMonitor.jspx (revision 18928) +++ web/auctionMonitor.jspx (working copy) @@ -324,7 +324,7 @@ title="Enter your message text" styleClass="textField"/> <ice:commandButton id="button_send_message" value="Send Message" action="send" + value="Send Message" action="auctionMonitor.iface" styleClass="orangeButtons" title="Send your message text"/> </ice:column>
        Hide
        Pavel Kuzin added a comment -

        Icefaces 1.8.2 don`t want to build with JSF 2.0

        BridgeExternalContext does`t have property getRequestURI();

        jsf2:
        [javac] Compiling 2 source files to /home/kuzmich/Soft/Icefaces/trunk/icefaces/core/build/classes
        [javac] /home/kuzmich/Soft/Icefaces/trunk/icefaces/core/src/org/icefaces/x/context/BridgeExternalContext2.java:387: cannot find symbol
        [javac] symbol : method getRequestURI()
        [javac] location: class com.icesoft.faces.context.BridgeExternalContext
        [javac] return wrapped.getRequestURI();
        [javac] ^
        [javac] Note: Some input files use unchecked or unsafe operations.
        [javac] Note: Recompile with -Xlint:unchecked for details.
        [javac] 1 error
        [javac] Compile failed; see the compiler error output for details.
        [copy] Copying 4 files to /home/kuzmich/Soft/Icefaces/trunk/icefaces/core/build/classes

        Show
        Pavel Kuzin added a comment - Icefaces 1.8.2 don`t want to build with JSF 2.0 BridgeExternalContext does`t have property getRequestURI(); jsf2: [javac] Compiling 2 source files to /home/kuzmich/Soft/Icefaces/trunk/icefaces/core/build/classes [javac] /home/kuzmich/Soft/Icefaces/trunk/icefaces/core/src/org/icefaces/x/context/BridgeExternalContext2.java:387: cannot find symbol [javac] symbol : method getRequestURI() [javac] location: class com.icesoft.faces.context.BridgeExternalContext [javac] return wrapped.getRequestURI(); [javac] ^ [javac] Note: Some input files use unchecked or unsafe operations. [javac] Note: Recompile with -Xlint:unchecked for details. [javac] 1 error [javac] Compile failed; see the compiler error output for details. [copy] Copying 4 files to /home/kuzmich/Soft/Icefaces/trunk/icefaces/core/build/classes
        Hide
        Pavel Kuzin added a comment -

        It seems getRequestURI was removed in revision 19219

        Show
        Pavel Kuzin added a comment - It seems getRequestURI was removed in revision 19219
        Hide
        Ted Goddard added a comment -

        We would recommend that you use ICEfaces 2.0 (the Alpha release is now available) with JSF 2.0. Do you have a project that requires ICEfaces 1.8.x on JSF 2.0, or can you upgrade to ICEfaces 2.0?

        Show
        Ted Goddard added a comment - We would recommend that you use ICEfaces 2.0 (the Alpha release is now available) with JSF 2.0. Do you have a project that requires ICEfaces 1.8.x on JSF 2.0, or can you upgrade to ICEfaces 2.0?
        Hide
        Ted Goddard added a comment -

        For GlassFish v3, use the following web.xml to ensure that JSF 1.2 bundled with the application is used:

        <?xml version="1.0" encoding="UTF-8"?>
        <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd">
        <sun-web-app >
        <class-loader delegate="false"/>
        <property name="useBundledJsf" value="true"/>
        </sun-web-app>

        Show
        Ted Goddard added a comment - For GlassFish v3, use the following web.xml to ensure that JSF 1.2 bundled with the application is used: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN" "http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd"> <sun-web-app > <class-loader delegate="false"/> <property name="useBundledJsf" value="true"/> </sun-web-app>

          People

          • Assignee:
            Unassigned
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: