Author: chris.laprun(a)jboss.com
Date: 2010-12-09 09:42:02 -0500 (Thu, 09 Dec 2010)
New Revision: 5527
Modified:
components/wsrp/branches/2.0.x/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/branches/2.0.x/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java
===================================================================
---
components/wsrp/branches/2.0.x/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-12-09
14:11:08 UTC (rev 5526)
+++
components/wsrp/branches/2.0.x/common/src/main/java/org/gatein/wsrp/WSRPResourceURL.java 2010-12-09
14:42:02 UTC (rev 5527)
@@ -99,7 +99,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
@@ -153,7 +153,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
@@ -173,12 +174,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