Skip to content

Commit 5a6d0a4

Browse files
committed
Merge branch '3.0.x' into 3.1.x
2 parents ef87ee7 + 2498a10 commit 5a6d0a4

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

grails-test-suite-web/src/test/groovy/org/grails/web/mapping/DoubleWildcardUrlMappingTests.groovy

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ class DoubleWildCardController {
7171
UrlMappingInfo info = infos[0]
7272
info.configure webRequest
7373
assertEquals 'wrong controller name', 'someOther', info.getControllerName()
74+
75+
76+
infos = holder.matchAll('/someOther/1+2')
77+
assert infos
78+
79+
info = infos[0]
80+
info.configure webRequest
81+
assertEquals 'wrong controller name', 'someOther', info.getControllerName()
82+
assertEquals 'wrong controller name', '1+2', info.getActionName()
83+
7484
}
7585

7686
void testDoubleWildcardInParam() {

grails-web-mvc/src/main/groovy/org/grails/web/servlet/mvc/GrailsWebRequestFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse
6262
try {
6363
WebUtils.storeGrailsWebRequest(webRequest);
6464

65-
if(!WebUtils.isForward(request)) {
65+
if(!WebUtils.isForwardOrInclude(request)) {
6666
// Set the flash scope instance to its next state. We do
6767
// this here so that the flash is available from Grails
6868
// filters in a valid state.

grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/AbstractUrlMappingInfo.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,7 @@
2020

2121
import java.io.UnsupportedEncodingException;
2222
import java.net.URLDecoder;
23-
import java.util.Collection;
24-
import java.util.Collections;
25-
import java.util.Comparator;
26-
import java.util.LinkedHashMap;
27-
import java.util.List;
28-
import java.util.Map;
23+
import java.util.*;
2924

3025
import grails.util.GrailsStringUtils;
3126
import org.grails.web.servlet.mvc.GrailsWebRequest;
@@ -49,7 +44,7 @@ public Map<String, Object> getParams() {
4944

5045
public void setParams(final Map newParams) {
5146
Collection keys = newParams.keySet();
52-
keys = DefaultGroovyMethods.toList(keys);
47+
keys = new ArrayList(keys);
5348
Collections.sort((List) keys, new Comparator() {
5449
public int compare(Object leftKey, Object rightKey) {
5550
Object leftValue = newParams.get(leftKey);
@@ -90,13 +85,8 @@ protected void populateParamsForMapping(GrailsWebRequest webRequest) {
9085
if (param instanceof Closure) {
9186
param = evaluateNameForValue(param);
9287
}
93-
if (param instanceof String) {
94-
try {
95-
param = URLDecoder.decode((String) param, encoding);
96-
}
97-
catch (UnsupportedEncodingException e) {
98-
param = evaluateNameForValue(param);
99-
}
88+
if (param instanceof CharSequence) {
89+
param = param.toString();
10090
}
10191
dispatchParams.put(name, param);
10292
}

grails-web-url-mappings/src/main/groovy/org/grails/web/mapping/mvc/UrlMappingsHandlerMapping.groovy

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ class UrlMappingsHandlerMapping extends AbstractHandlerMapping {
164164
request.setAttribute(MATCHED_REQUEST, info)
165165
return info
166166
}
167-
else if(info.viewName || info.URI) return info
167+
else if(info.viewName || info.URI) {
168+
return info
169+
}
168170
}
169171
}
170172

0 commit comments

Comments
 (0)