Details
Description
If you specify the connectionLostRedirectURI in your web.xml and forget to single quote the URL, the resulting js configuration string will be corrupted. We should check for this when loading the parameter.
Activity
Philip Breau
created issue -
Ken Fyten
made changes -
Field | Original Value | New Value |
---|---|---|
Priority | Major [ 3 ] | Minor [ 4 ] |
Michael Thiem
made changes -
Support Case References | https://www.icesoft.ca:4443/supportilla/show_bug.cgi?id=4833 |
Ken Fyten
made changes -
Fix Version/s | 1.7.1 [ 10122 ] | |
Assignee Priority | P2 | |
Assignee | Mircea Toma [ mircea.toma ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #16645 | Wed May 14 15:43:52 MDT 2008 | mircea.toma | Add single quotes. Remove single quotes set by user. |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java
|
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #16646 | Wed May 14 15:56:11 MDT 2008 | mircea.toma | Add single quotes. Remove single quotes set by user. |
Files Changed | ||||
MODIFY
/icefaces/branches/icefaces-1.7/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java
|
Mircea Toma
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P2 | |
Assignee | Mircea Toma [ mircea.toma ] |
suggested fix:
Index: C:/Users/Philip/workspace/ICEfaces Head/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java
===================================================================
— C:/Users/Philip/workspace/ICEfaces Head/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java (revision 14269)
+++ C:/Users/Philip/workspace/ICEfaces Head/icefaces/core/src/com/icesoft/faces/context/DOMResponseWriter.java (working copy)
@@ -354,10 +354,15 @@
ElementController.from(session).addInto(body);
String sessionIDScript = "window.session='" + context.getIceFacesId() + "'; ";
{ + log.warn( configuration.getAttribute("connectionLostRedirectURI","") + " is not a valid URL for 'connectionLostRedirectURI'"); + connectionLostRedirectURI = "null"; + }+ String connectionLostRedirectURI = configuration.getAttributeAsSingleQuotedRelativeURL("connectionLostRedirectURI", "null");
+ if( connectionLostRedirectURI == null )
String configurationScript =
"window.configuration = {" +
"synchronous: " + configuration.getAttribute("synchronousUpdate", "false") + "," +
+ "redirectURI: " + connectionLostRedirectURI + "," +
"connection: {" +
"context: '" + context.getApplication().getViewHandler().getResourceURL(context, "/") + "'," +
"timeout: " + configuration.getAttributeAsLong("connectionTimeout", 30000) + "," +
Index: C:/Users/Philip/workspace/ICEfaces Head/icefaces/core/src/com/icesoft/faces/webapp/http/common/Configuration.java
===================================================================
— C:/Users/Philip/workspace/ICEfaces Head/icefaces/core/src/com/icesoft/faces/webapp/http/common/Configuration.java (revision 14269)
+++ C:/Users/Philip/workspace/ICEfaces Head/icefaces/core/src/com/icesoft/faces/webapp/http/common/Configuration.java (working copy)
@@ -1,5 +1,10 @@
package com.icesoft.faces.webapp.http.common;
+import java.util.regex.Pattern;
{ public abstract String getName(); @@ -147,4 +152,43 @@ return defaultValue; }+
+import javax.faces.context.FacesContext;
+
+
public abstract class Configuration
}
{ + + //modify url to ensure it starts with '/ and ends with ' + if( result.startsWith("'")) + result = result.substring(1); + if( result.startsWith("/")) + result = result.substring(1); + result = "'/" + result; + if( !result.endsWith("'")) + result += "'"; + }+
+ public String getAttributeAsSingleQuotedRelativeURL(String name, String defaultValue){
+ String result = defaultValue;
+ try{
+ result = getAttributeAsRelativeURL(name,defaultValue);
+ if( result != null && !result.equals(defaultValue))
+ }
{ + result = null; + }+ catch( ConfigurationException e)
+
{ + throw new ConfigurationException( result + " is not a valid URL for " + name); + }+ return result;
+ }
+
+ public String getAttributeAsRelativeURL(String name, String defaultValue)
+ throws ConfigurationException{
+ String result = getAttribute(name);
+ if( result != null ){
+ result = result.trim();
+ if( ! Pattern.matches("^/\\S./+$", result) )
+
+ return result;
+ }
+ return defaultValue;
+ }
+
+
}