Index: src/com/icesoft/faces/context/DOMResponseWriter.java =================================================================== --- src/com/icesoft/faces/context/DOMResponseWriter.java (revision 21745) +++ src/com/icesoft/faces/context/DOMResponseWriter.java Thu Jul 08 09:59:53 PDT 2010 @@ -391,26 +391,25 @@ //todo: build startup script only once on aplication startup boolean synchronousMode = configuration.getAttributeAsBoolean("synchronousUpdate", false); String startupScript = - "window.disposeViewsURI = '" + blockingRequestHandlerContext + "block/dispose-views';\n" + + "window.disposeViewsURI = '" + encodeURL(externalContext, blockingRequestHandlerContext + "block/dispose-views") +"';\n" + "var container = '" + configurationID + "'.asElement().parentNode;\n" + "container.bridge = new Ice.Community.Application({" + "optimizedJSListenerCleanup: " + configuration.getAttribute("optimizedJSListenerCleanup", "false") + "," + "session: '" + sessionIdentifier + "'," + "view: " + viewIdentifier + "," + "synchronous: " + synchronousMode + "," + - "connectionLostRedirectURI: " + connectionLostRedirectURI + "," + - "sessionExpiredRedirectURI: " + sessionExpiredRedirectURI + "," + + "connectionLostRedirectURI: " + encodeURL(externalContext, connectionLostRedirectURI) + "," + + "sessionExpiredRedirectURI: " + encodeURL(externalContext, sessionExpiredRedirectURI) + "," + "serverErrorRetryTimeouts: [" + configuration.getAttribute("serverErrorRetryTimeouts", "1000 2000 4000").trim().replaceAll("\\s+", ",") + "], " + "connection: {" + "blockUI: " + configuration.getAttribute("blockUIOnSubmit", "false") + "," + "context: '" + contextPath + "', " + + "sendReceiveUpdatesURI: '" + encodeURL(externalContext, contextPath + "block/send-receive-updates") + "'," + (synchronousMode ? - //encode path for URL rewrite session tracking mode - ("sendReceiveUpdatesURI: '" + externalContext.encodeResourceURL(contextPath + "block/send-receive-updates") + "',") : - ("sendReceiveUpdatesURI: '" + contextPath + "block/send-receive-updates" + "'," + - "pingURI: '" + contextPath + "block/ping" + "'," + - "receiveUpdatesURI: '" + contextPath + "block/receive-updates" + "'," + - "receiveUpdatedViewsURI: '" + blockingRequestHandlerContext + "block/receive-updated-views" + "',") + + ("") : + ("pingURI: '" + encodeURL(externalContext, contextPath + "block/ping") + "'," + + "receiveUpdatesURI: '" + encodeURL(externalContext, contextPath + "block/receive-updates") + "'," + + "receiveUpdatedViewsURI: '" + encodeURL(externalContext, blockingRequestHandlerContext + "block/receive-updated-views") + "',") + "heartbeat: {" + "interval: " + configuration.getAttributeAsLong("heartbeatInterval", 50000) + "," + "timeout: " + configuration.getAttributeAsLong("heartbeatTimeout", 30000) + "," + @@ -476,6 +475,13 @@ } } + private static String encodeURL(ExternalContext ec, String url){ + if(url == null || url.equals("null")){ + return url; + } + return ec.encodeResourceURL(url); + } + private void enhanceHead(Element head) { Element meta = (Element) head.appendChild(document.createElement("meta")); meta.setAttribute("name", "icefaces");