| Issue 218: | @ActionPathと@Varの組み合わせで最長一致になっていない | |
| 1 person starred this issue and may be notified of changes. | Back to list |
{{{
@Page("hoge/{foo}/{bar}")
public class HogePage {
@Default
public Navigation default_() {
.....
}
@GET
@ActionPath
public Navigartion execute(@Var("hoge") String hoge, @Var("bar") String
bar, Request request)....
}
}}}
のようなときに@Defualtが優先されていないらしい。
調査が必要。
Jun 5, 2009
まだ、期待通りの動作をするに到っていません。
以下の様なPageクラスがある時。
{{{
@Page("/var/{hoge}")
public class TestVarPage {
@Default
public Navigation index(@Var("hoge") String hoge, final Request request) {
return null;
}
@ActionPath("{fuga}")
public Navigation fuga(@Var("hoge") String hoge, @Var("fuga") String fuga, final
Request request) {
return null;
}
}
}}}
ttp://hoge.com/context/var/10
というリクエストでは、indexメソッドが呼び出され、
仮引数hogeには、「10」がバインドされ、
ttp://hoge.com/context/var/10/20
というリクエストでは、fugaメソッドが呼び出され、
仮引数hogeには、「10」
仮引数fugaには、「20」がバインドされる事を期待しています。
また、以下の様なPageクラスがある時、
{{{
@Page("/var/{hoge}")
public class TestVarPage {
@Default
public Navigation index(@Var("hoge") String hoge, final Request request) {
return null;
}
}
}}}
ttp://hoge.com/context/var/10/20
というリクエストでは、indexメソッドが呼び出され、
仮引数hogeには、「10」がバインドされる事を期待しています。
このケースでは、現状、nullがバインドされます。
Status:
WontFix
Jun 5, 2009
(No comment was entered for this change.)
Status:
Started
Jun 5, 2009
前者の例のサンプルをコミットしました。 t2-samplesのLookupTest2Pageです。 ttp://domain/context/issue218_2/AAA -> @Defaultメソッド(hogeにはAAA) ttp://domain/context/issue218_2/AAA/BBB -> @ActionPathのメソッド(hogeにはAAA, fooに はBBBが入る) という挙動になります。
Jun 7, 2009
ひとまず前者の例は、解決したようなのでcloseします。 後者の例は仕様面での変更があるので、また別途。
Status:
Fixed
|
Labels: Milestone-T2-0.6