You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by st...@apache.org on 2011/11/23 21:51:04 UTC
svn commit: r1205582 - in
/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main:
java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/ClientSideWindowHandler.java
resources/static/windowhandler.html
Author: struberg
Date: Wed Nov 23 20:51:04 2011
New Revision: 1205582
URL: http://svn.apache.org/viewvc?rev=1205582&view=rev
Log:
EXTCDI-242 shorten requestToken
Modified:
myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/ClientSideWindowHandler.java
myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/resources/static/windowhandler.html
Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/ClientSideWindowHandler.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/ClientSideWindowHandler.java?rev=1205582&r1=1205581&r2=1205582&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/ClientSideWindowHandler.java (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/java/org/apache/myfaces/extensions/cdi/jsf/impl/scope/conversation/ClientSideWindowHandler.java Wed Nov 23 20:51:04 2011
@@ -48,12 +48,12 @@ public class ClientSideWindowHandler ext
private static final long serialVersionUID = 5293942986187078113L;
private static final String WINDOW_ID_COOKIE_SUFFIX = "-codiWindowId";
- private static final String CODI_REQUEST_TOKEN = "codiToken";
+ private static final String CODI_REQUEST_TOKEN = "mfRid";
private static final String UNINITIALIZED_WINDOW_ID_VALUE = "uninitializedWindowId";
private static final String WINDOW_ID_REPLACE_PATTERN = "$$windowIdValue$$";
private static final String NOSCRIPT_URL_REPLACE_PATTERN = "$$noscriptUrl$$";
- private static final String NOSCRIPT_PARAMETER = "codiNoWh";
+ private static final String NOSCRIPT_PARAMETER = "mfDirect";
@Inject
private ClientConfig clientConfig;
@@ -83,24 +83,6 @@ public class ClientSideWindowHandler ext
* {@inheritDoc}
*/
@Override
- public String encodeURL(String url)
- {
- if (this.clientConfig.isJavaScriptEnabled())
- {
- // do not add the windowId
- return url;
- }
- else
- {
- // fallback - we have to add the windowId to the URL if JavaScript is disabled
- return addWindowIdIfNecessary(url, getCurrentWindowId());
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
public String restoreWindowId(ExternalContext externalContext)
{
if (this.clientConfig.isJavaScriptEnabled())
@@ -277,18 +259,4 @@ public class ClientSideWindowHandler ext
return "";
}
-
- private String getEncodedContextPath(ExternalContext externalContext)
- {
- String contextPath = externalContext.getRequestContextPath();
- if (contextPath != null)
- {
- // remove all "/", because they can be different in JavaScript
- contextPath = contextPath.replace("/", "");
-
- return JsfUtils.encodeURLParameterValue(contextPath, externalContext);
- }
-
- return "";
- }
}
Modified: myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/resources/static/windowhandler.html
URL: http://svn.apache.org/viewvc/myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/resources/static/windowhandler.html?rev=1205582&r1=1205581&r2=1205582&view=diff
==============================================================================
--- myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/resources/static/windowhandler.html (original)
+++ myfaces/extensions/cdi/trunk/jee-modules/jsf-module/impl/src/main/resources/static/windowhandler.html Wed Nov 23 20:51:04 2011
@@ -184,8 +184,8 @@ window.onload = function() {
expdt.setTime(expdt.getTime()+(2*1000));
var expires = "; expires="+expdt.toGMTString();
- var requestToken = Math.floor(Math.random()*100000001);
- var newUrl = setUrlParam(window.location.href, "codiToken", requestToken);
+ var requestToken = Math.floor(Math.random()*10001);
+ var newUrl = setUrlParam(window.location.href, "mfRid", requestToken);
document.cookie = requestToken + '-codiWindowId=' + windowId + expires;