Author: chris.laprun(a)jboss.com
Date: 2010-12-09 11:25:33 -0500 (Thu, 09 Dec 2010)
New Revision: 5538
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
Log:
- GTNWSRP-150: resourceId needs to be URL-encoded and decoded.
- Parameters need to be removed from URL once they've been processed.
Modified: components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-12-09
15:50:23 UTC (rev 5537)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-12-09
16:25:33 UTC (rev 5538)
@@ -104,7 +104,7 @@
if (resourceId != null)
{
- createURLParameter(sb, WSRP2RewritingConstants.RESOURCE_ID, resourceId);
+ createURLParameter(sb, WSRP2RewritingConstants.RESOURCE_ID,
URLTools.encodeXWWWFormURL(resourceId));
}
// false is the default value, so we don't actually need to add it to the
string
@@ -158,7 +158,8 @@
String resourceIDParam = getRawParameterValueFor(params,
WSRP2RewritingConstants.RESOURCE_ID);
if (resourceIDParam != null)
{
- resourceId = resourceIDParam;
+ resourceId = URLTools.decodeXWWWFormURL(resourceIDParam);
+ params.remove(WSRP2RewritingConstants.RESOURCE_ID);
}
// GTNWSRP-103: if we don't have a resource id and wsrp-requiresRewrite has not
been specified, set it to false for better compatibility
@@ -178,12 +179,14 @@
if (preferOperationParam != null)
{
preferOperation = Boolean.valueOf(preferOperationParam);
+ params.remove(WSRP2RewritingConstants.RESOURCE_PREFER_OPERATION);
}
String cacheabilityParam = getRawParameterValueFor(params,
WSRP2RewritingConstants.RESOURCE_CACHEABILITY);
if (cacheabilityParam != null)
{
cacheability =
WSRPUtils.getCacheLevelFromResourceCacheability(cacheabilityParam);
+ params.remove(WSRP2RewritingConstants.RESOURCE_CACHEABILITY);
}
if (resourceIDParam == null && url == null)
Show replies by date