ICEfaces
  1. ICEfaces
  2. ICE-9842

ClassCastException thrown when loading non-ICEfaces pages

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-1.8.2.GA_P07
    • Fix Version/s: EE-1.8.2.GA_P08
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      Woodstock
    • Assignee Priority:
      P2
    • Salesforce Case Reference:

      Description

      From the changes made in ICE-7941 a ClassCastException is thrown when accessing a non-ICEfaces page. In the customers use case they have some old Woodstock components on these pages.

        Activity

        Hide
        Arran Mccullough added a comment -

        The following code fix has been confirmed by the customer:

        private String getContextPath(ExternalContext extContext) {
        if (contextPath == null) {
        ServletContext servletContext = (ServletContext) extContext.getContext();
        String publicContextPath = servletContext.getInitParameter("publicContextPath");
        if (null != publicContextPath)

        { contextPath = publicContextPath; }

        else

        { contextPath = extContext.getRequestContextPath(); }

        // Configuration configuration = ((BridgeExternalContext) extContext).getConfiguration();
        // contextPath = configuration.getAttribute("publicContextPath", extContext.getRequestContextPath());
        if (!contextPath.startsWith("/"))

        { contextPath = "/" + contextPath; }

        if (contextPath.endsWith("/"))

        { contextPath = contextPath.substring(0, contextPath.length() - 1); }

        }

        return contextPath;
        }

        Show
        Arran Mccullough added a comment - The following code fix has been confirmed by the customer: private String getContextPath(ExternalContext extContext) { if (contextPath == null) { ServletContext servletContext = (ServletContext) extContext.getContext(); String publicContextPath = servletContext.getInitParameter("publicContextPath"); if (null != publicContextPath) { contextPath = publicContextPath; } else { contextPath = extContext.getRequestContextPath(); } // Configuration configuration = ((BridgeExternalContext) extContext).getConfiguration(); // contextPath = configuration.getAttribute("publicContextPath", extContext.getRequestContextPath()); if (!contextPath.startsWith("/")) { contextPath = "/" + contextPath; } if (contextPath.endsWith("/")) { contextPath = contextPath.substring(0, contextPath.length() - 1); } } return contextPath; }
        Hide
        Brett Bergquist added a comment -

        Actually we don't have pages with a mixture of Woodstock and ICEFaces, but rather an application that has pages that have Woodstock components and pages that have ICEFaces components. However, both pages are served through ICEfaces ViewHandler.

        Show
        Brett Bergquist added a comment - Actually we don't have pages with a mixture of Woodstock and ICEFaces, but rather an application that has pages that have Woodstock components and pages that have ICEFaces components. However, both pages are served through ICEfaces ViewHandler.
        Hide
        Mircea Toma added a comment - - edited

        Modified D2DViewHandler.getContextPath method to use the generic ExternalContext instead of the custom Configuration object to read com.icesoft.faces.publicContextPath context parameter.

        Show
        Mircea Toma added a comment - - edited Modified D2DViewHandler.getContextPath method to use the generic ExternalContext instead of the custom Configuration object to read com.icesoft.faces.publicContextPath context parameter.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: