diff --git a/framework/src/play/mvc/Router.java b/framework/src/play/mvc/Router.java index 5469c87694..988024556b 100644 --- a/framework/src/play/mvc/Router.java +++ b/framework/src/play/mvc/Router.java @@ -491,7 +491,7 @@ public static ActionDefinition reverse(String action, Map args) } } else if (route.staticArgs.containsKey(key)) { // Do nothing -> The key is static - } else if (Scope.RouteArgs.current() != null && Scope.RouteArgs.current().data.containsKey(key)) { + } else if (!argsbackup.containsKey(key)) { // Do nothing -> The key is provided in RouteArgs and not used (see #447) } else if (value != null) { if (List.class.isAssignableFrom(value.getClass())) { diff --git a/samples-and-tests/just-test-cases/app/controllers/Application.java b/samples-and-tests/just-test-cases/app/controllers/Application.java index 329627a81c..dda88f1ea4 100644 --- a/samples-and-tests/just-test-cases/app/controllers/Application.java +++ b/samples-and-tests/just-test-cases/app/controllers/Application.java @@ -152,6 +152,10 @@ public static void optional() { renderText("OK"); } + public static void withQueryParam(String lucky) { + renderText("OK"); + } + public static void reverserouting() { render("Application/reverse.html"); } diff --git a/samples-and-tests/just-test-cases/app/views/Application/reverse.html b/samples-and-tests/just-test-cases/app/views/Application/reverse.html index ecfb8680ea..3d5f27d9cc 100644 --- a/samples-and-tests/just-test-cases/app/views/Application/reverse.html +++ b/samples-and-tests/just-test-cases/app/views/Application/reverse.html @@ -8,4 +8,6 @@
@{Application.aGetForm2()}
@{Application.aGetForm('Yop')}
@{Application.aGetForm2('Yop')}
-
@{Application.optional()}
\ No newline at end of file +
@{Application.optional()}
+
@{Application.withQueryParam()}
+
@{Application.withQueryParam("duck")}
diff --git a/samples-and-tests/just-test-cases/conf/routes b/samples-and-tests/just-test-cases/conf/routes index 3e1167d8b5..1f39745eee 100644 --- a/samples-and-tests/just-test-cases/conf/routes +++ b/samples-and-tests/just-test-cases/conf/routes @@ -14,6 +14,7 @@ GET /re/{<[0-9]{5}>re} Application.ok GET /re/{<[A-Z]{2,4}>re} Application.ok GET /{lucky}/doIt Application.showIt +GET /withQueryParam Application.withQueryParam GET www.zenexity.com/hello Application.helloZen GET /st%C3%A9phane Application.helloSteph diff --git a/samples-and-tests/just-test-cases/test/routing.test.html b/samples-and-tests/just-test-cases/test/routing.test.html index d0e80a59f2..73d6bd9b8c 100644 --- a/samples-and-tests/just-test-cases/test/routing.test.html +++ b/samples-and-tests/just-test-cases/test/routing.test.html @@ -111,6 +111,8 @@ assertText('g', '/aGetForm?name=Yop') assertText('h', '/aGetForm/?name=Yop') assertText('i', '/optionalSlash') + assertText('j', '/withQueryParam') + assertText('k', '/withQueryParam?lucky=duck') // Reverse open('@{Application.reverserouting2()}')