How can I specify empty positional params for IndexedParamUrlCodingStrategy?
我有<条码>。
mount(new IndexedParamUrlCodingStrategy("search", SearchPage.class));
这使我能够建设诸如:
/search/category/searchTerm/all/21-30
我可以成功地用以下方式检索位置部分:
String category = parameters.getString("0", "");
String searchTerm = parameters.getString("1", "");
String filter = parameters.getString("2", "all");
String pagination = parameters.getString("3", "1-10");
这使得卢爱尔人能够使用空洞的 para子,例如:
/search//searchTerm/all/21-30 /* no category specified */
这项工程罚款,但我看上去:createlink to the SearchPage
with loss params.
params.put("0", ""); // try to set "empty" category
params.put("1", "searchTerm");
params.put("2", "all");
params.put("3", "21-30");
BookmarkablePageLink<SearchPage> link = new BookmarkablePageLink<SearchPage>("link", SearchPage.class, linkParams);
这导致与《欧洲公路货运公约》等联系:
/search/searchTerm/all/21-30
而不是我的意图:
/search//searchTerm/all/21-30