You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by jc...@apache.org on 2008/10/02 16:12:19 UTC
svn commit: r701133 - in
/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request:
CryptedUrlWebRequestCodingStrategy.java
urlcompressing/UrlCompressingWebCodingStrategy.java
Author: jcompagner
Date: Thu Oct 2 07:12:18 2008
New Revision: 701133
URL: http://svn.apache.org/viewvc?rev=701133&view=rev
Log:
fixes for Compressing/Crypting urls and the IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME param. The param was not set and the url wasnt properly decoded when getting back in
Modified:
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/CryptedUrlWebRequestCodingStrategy.java
wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/urlcompressing/UrlCompressingWebCodingStrategy.java
Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/CryptedUrlWebRequestCodingStrategy.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/CryptedUrlWebRequestCodingStrategy.java?rev=701133&r1=701132&r2=701133&view=diff
==============================================================================
--- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/CryptedUrlWebRequestCodingStrategy.java (original)
+++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/CryptedUrlWebRequestCodingStrategy.java Thu Oct 2 07:12:18 2008
@@ -122,8 +122,7 @@
}
/**
- * @see org.apache.wicket.request.IRequestTargetMounter#mount(
- * org.apache.wicket.request.target.coding.IRequestTargetUrlCodingStrategy)
+ * @see org.apache.wicket.request.IRequestTargetMounter#mount(org.apache.wicket.request.target.coding.IRequestTargetUrlCodingStrategy)
*/
public void mount(IRequestTargetUrlCodingStrategy urlCodingStrategy)
{
@@ -387,8 +386,12 @@
// Remove the 'x' parameter which contains ALL the encoded params
parameterMap.remove("x");
- String decodedParamReplacement = encodedParamReplacement;
- decodedParamReplacement = WicketURLDecoder.QUERY_INSTANCE.decode(encodedParamReplacement);
+ // first replace all & with & else the they wont be encoded because there where
+ // encrypted.
+ String decodedParamReplacement = Strings.replaceAll(encodedParamReplacement, "&",
+ "&").toString();
+
+ decodedParamReplacement = WicketURLDecoder.QUERY_INSTANCE.decode(decodedParamReplacement);
// Add ALL of the params from the decoded 'x' param
ValueMap params = new ValueMap();
Modified: wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/urlcompressing/UrlCompressingWebCodingStrategy.java
URL: http://svn.apache.org/viewvc/wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/urlcompressing/UrlCompressingWebCodingStrategy.java?rev=701133&r1=701132&r2=701133&view=diff
==============================================================================
--- wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/urlcompressing/UrlCompressingWebCodingStrategy.java (original)
+++ wicket/branches/wicket-1.3.x/jdk-1.4/wicket/src/main/java/org/apache/wicket/protocol/http/request/urlcompressing/UrlCompressingWebCodingStrategy.java Thu Oct 2 07:12:18 2008
@@ -60,7 +60,7 @@
* @return the encoded url
*/
protected CharSequence encode(RequestCycle requestCycle,
- IListenerInterfaceRequestTarget requestTarget)
+ IListenerInterfaceRequestTarget requestTarget)
{
final RequestListenerInterface rli = requestTarget.getRequestListenerInterface();
@@ -89,7 +89,7 @@
url.append(page.getId());
url.append(Component.PATH_SEPARATOR);
url.append(((WebPage)page).getUrlCompressor().getUIDForComponentAndInterface(component,
- listenerName));
+ listenerName));
listenerName = null;
}
else
@@ -131,10 +131,10 @@
{
url.append(params.getUrlDepth());
}
- if (IActivePageBehaviorListener.INTERFACE.getName().equals(listenerName))
+ if (IActivePageBehaviorListener.INTERFACE.getName().equals(rli.getName()))
{
url.append(url.indexOf("?") > -1 ? "&" : "?").append(
- IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME).append("=true");
+ IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME).append("=true");
}
return requestCycle.getOriginalResponse().encodeURL(url);
}