Details
-
Type: Bug
-
Status: Closed
-
Priority: 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=";
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
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
Patrick Corless
created issue -
Migration
made changes -
Field | Original Value | New Value |
---|---|---|
Summary | component showcase source code URL is static url | ICEfaces Showcase source code URL is static url (was: component showcase source code URL is static url) |
Assignee | Matthew Cowell [ cowemat ] | |
Affects | Sample App./Tutorial,Compatibility/Configuration [ 10001, 10002 ] | |
Assignee Priority | P1 [ 10010 ] |
Migration
made changes -
Status | Open [ 1 ] | Closed [ 6 ] |
Resolution | Won't Fix [ 2 ] |