带Wicket的正则表达式mountPage

夸克

我需要能够使用正则表达式使用Wicket挂载页面:

mountPage("/app/create", CreatePage.class);
mountPage("/^[0-9a-zA-Z-]+$", ViewPage.class); // Like this

我曾尝试PatternMountedMapper从55分钟。

mount(new PatternMountedMapper("/#{hash:^[0-9a-zA-Z-]+$}", ViewPage.class));

但是,该代码甚至无法捕获到az,AZ,0-9模式甚至路径,/_ah/admin/因此它不起作用。哪种解决方案最适合此要求?

安德里亚·德尔·贝内(Andrea Del Bene)

如果使用'#'则使用'$'并将Exact设置为true:

        mount(new PatternMountedMapper("/${hash:^[0-9a-zA-Z-]+$}", TargetPage.class).setExact(true));

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章