ICEfaces
  1. ICEfaces
  2. ICE-8340

ICEfaces Showcase source code URL is static url (was: component showcase source code URL is static url)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Sample Apps
    • Labels:
      None
    • Environment:
      any
    • Assignee Priority:
      P1
    • Affects:
      Sample App./Tutorial, Compatibility/Configuration

      Description

      During the development work to integration of Component Showcase into the Eclipse project environment. It was found that httpRequest.getLocalName() in the SourceCodeLoaderConnection.java was returning an 0.0.0.0.0.0 for the device's IP address. Liming is looking into possible configuration optioned within the IDE but there is an issue with the code block below

          if ((request != null) && (request instanceof HttpServletRequest)) {
                  HttpServletRequest httpRequest = (HttpServletRequest)request;
                  
                  SOURCE_SERVLET_URL = "http://" +
                                       httpRequest.getLocalName() +
                                       ":" +
                                       httpRequest.getLocalPort() +
                                       httpRequest.getContextPath() +
                                       "/";
              }
              else {
                  String fromFile = FacesUtils.getFacesParameter("org.icefaces.samples.showcase.SOURCE_SERVLET_URL");
                  
                  if (fromFile != null) {
                      SOURCE_SERVLET_URL = fromFile;
                  }
                  else {
                      SOURCE_SERVLET_URL = "http://localhost:8080/comp-suite/";
                  }
              }

      As a potential work around the context param "org.icefaces.samples.showcase.SOURCE_SERVLET_URL" should be be able to be used to alter the SOURCE_SERVLET_URL but unfortunately the else block will never execute.

      The code block should probably look something like this so the the context parameter can be detected and used.

              String fromFile = FacesUtils.getFacesParameter("org.icefaces.samples.showcase.SOURCE_SERVLET_URL");
              Object request = FacesContext.getCurrentInstance().getExternalContext().getRequest();
              if ("".equals(fromFile)) {
                  HttpServletRequest httpRequest = (HttpServletRequest)request;
                  
                  SOURCE_SERVLET_URL = "http://" +
                                       httpRequest.getLocalName() +
                                       ":" +
                                       httpRequest.getLocalPort() +
                                       httpRequest.getContextPath() +
                                       "/";
              }
              else {
                 SOURCE_SERVLET_URL = fromFile;
              }
              SOURCE_SERVLET_URL += "sourcecodeStream.html?path=";

        Activity

        Hide
        Patrick Corless added a comment -

        One more thing, it would also be great if the dependency on

        import org.apache.commons.collections.OrderedBidiMap;
        import org.apache.commons.collections.bidimap.TreeBidiMap;

        Could be removed to in favour of java.util.

        Show
        Patrick Corless added a comment - One more thing, it would also be great if the dependency on import org.apache.commons.collections.OrderedBidiMap; import org.apache.commons.collections.bidimap.TreeBidiMap; Could be removed to in favour of java.util.
        Hide
        Ken Fyten added a comment - - edited

        We won't pursue this as the compat/component-showcase sample has been replaced by the new showcase sample in the ICEfaces 3.x product.

        Show
        Ken Fyten added a comment - - edited We won't pursue this as the compat/component-showcase sample has been replaced by the new showcase sample in the ICEfaces 3.x product.

          People

          • Assignee:
            Matthew Cowell
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: