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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: