ICEfaces
  1. ICEfaces
  2. ICE-1074

netbeans vwp and forum ExternalContext.getRequestmap().put() not working

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.5.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      noted in the forum: http://www.icefaces.org/JForum/posts/list/0/3099.page#14950

      FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(name,
      value); isn't working.

      * to be verified

        Issue Links

          Activity

          Hide
          Frank Ye added a comment -

          seems to be the same failure for netbeans vwp as well.

          The bug lies in BridgeExternalContext.getRequestMap.

          Inside, com.sun.faces.application.ApplicationAssoicate -->

          scopeIsRequest ()
          context.getExternalContext().getRequestMap().put(managedBeanName, bean);

          Show
          Frank Ye added a comment - seems to be the same failure for netbeans vwp as well. The bug lies in BridgeExternalContext.getRequestMap. Inside, com.sun.faces.application.ApplicationAssoicate --> scopeIsRequest () context.getExternalContext().getRequestMap().put(managedBeanName, bean);
          Hide
          Frank Ye added a comment -

          The main problem here is the that servletRequest value not set.

          Sun's RI has the following RequestMap inner class in ExternalContextImpl

          map.put(key, value)

          { Object result = servletRequest.getAttribute(key); servletRequest.setAttribute(key, value); }

          Show
          Frank Ye added a comment - The main problem here is the that servletRequest value not set. Sun's RI has the following RequestMap inner class in ExternalContextImpl map.put(key, value) { Object result = servletRequest.getAttribute(key); servletRequest.setAttribute(key, value); }
          Hide
          Frank Ye added a comment -

          More summary:

          The LifecycleListener where implements ServletRequestAttributeListener is
          expecting to get called when a value is set on the RequestMap
          (called because it's a listener to any changes to the RequestMap) but the
          listener never gets called because ICEfaces does not really set
          the value on the Request, only in a HashMap stored
          with the BridgeExternalContext. We need to catch the
          requestMap.put() calls and pass them on to the real
          request so that the listener gets called.

          Show
          Frank Ye added a comment - More summary: The LifecycleListener where implements ServletRequestAttributeListener is expecting to get called when a value is set on the RequestMap (called because it's a listener to any changes to the RequestMap) but the listener never gets called because ICEfaces does not really set the value on the Request, only in a HashMap stored with the BridgeExternalContext. We need to catch the requestMap.put() calls and pass them on to the real request so that the listener gets called.
          Hide
          Ted Goddard added a comment -

          I will look into adding a ServletRequestMap wrapper to address this bug.

          Show
          Ted Goddard added a comment - I will look into adding a ServletRequestMap wrapper to address this bug.
          Hide
          Ted Goddard added a comment -

          Prototype with ServletRequestMap is functional, but does not have correct values upon page reload;
          continuing investigation.

          Show
          Ted Goddard added a comment - Prototype with ServletRequestMap is functional, but does not have correct values upon page reload; continuing investigation.
          Hide
          Ted Goddard added a comment -

          Change checked in to 1.5 branch and head.

          tedg@tetra:core> svn commit . -m "propagating requestMap.put through to actual request to support
          request listeners (ICE-1074)"
          Sending core/src/com/icesoft/faces/context/BridgeExternalContext.java
          Adding core/src/com/icesoft/faces/context/RequestMapWrapper.java
          Sending core/src/com/icesoft/faces/env/CommonEnvironmentRequest.java
          Adding core/src/com/icesoft/faces/util/ArrayEnumeration.java
          Committed revision 12761.

          Frank has tested an intermediate .jar. Reassigning to Frank to test 1.5 branch with Creator.

          Show
          Ted Goddard added a comment - Change checked in to 1.5 branch and head. tedg@tetra:core> svn commit . -m "propagating requestMap.put through to actual request to support request listeners ( ICE-1074 )" Sending core/src/com/icesoft/faces/context/BridgeExternalContext.java Adding core/src/com/icesoft/faces/context/RequestMapWrapper.java Sending core/src/com/icesoft/faces/env/CommonEnvironmentRequest.java Adding core/src/com/icesoft/faces/util/ArrayEnumeration.java Committed revision 12761. Frank has tested an intermediate .jar. Reassigning to Frank to test 1.5 branch with Creator.
          Hide
          Frank Ye added a comment -

          Not related issues now.

          I did a few rounds of test with revision 12761 .

          It works fine with Creator 2 old application framework implementation.
          Also works with first page shown up in netbeans 5.5 vwp.

          But, it is complicated further more with netbeans 5.5 vwp where if you put
          paging (any options, with Sun's paging or our dataPaginator). The connection is
          lost and cachedRowSet is null. It is a separated issue. So I will creating a
          new one to trace that.

          https://www.icesoft.ca:4443/iraptor/show_bug.cgi?id=1189

          I mark this one as Fixed since it seems no problem with requestMap.

          Show
          Frank Ye added a comment - Not related issues now. I did a few rounds of test with revision 12761 . It works fine with Creator 2 old application framework implementation. Also works with first page shown up in netbeans 5.5 vwp. But, it is complicated further more with netbeans 5.5 vwp where if you put paging (any options, with Sun's paging or our dataPaginator). The connection is lost and cachedRowSet is null. It is a separated issue. So I will creating a new one to trace that. https://www.icesoft.ca:4443/iraptor/show_bug.cgi?id=1189 I mark this one as Fixed since it seems no problem with requestMap.
          Hide
          Frank Ye added a comment -

          tested with following:

          netbeans VWP --> database connection (Java DB derby client JDBC driver) -->
          database binding --> paging and sort header components.

          So far, it looks fine. Mark as verified

          The sort header seems not working with All Object type. Except Issue. Needs to
          create a new one.

          Show
          Frank Ye added a comment - tested with following: netbeans VWP --> database connection (Java DB derby client JDBC driver) --> database binding --> paging and sort header components. So far, it looks fine. Mark as verified The sort header seems not working with All Object type. Except Issue. Needs to create a new one.

            People

            • Assignee:
              Frank Ye
              Reporter:
              Philip Breau
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: