Wicket 请求映射
我正在尝试以特殊的方式映射我的请求以实现一个非常简单的目的。
假设根网站是 abc.com
并且有多个用户。每个用户都有一个主页、管理页面、请求页面等。
假设我们有用户 user1
和 user 2
我希望网址编码为:
abc.com/user1/admin
abc.com/user1/home
abc.com/user1/requests
所以基本上 abc.com/user1/home
是 user 1
和 abc.com/user1/admin 的主页
是用户 1 的管理页面。
我尝试使用命名参数等在 wicket 中使用请求映射。我可以将我的 URL 编码为 abc.com/home/user1
但我可以没有得到编码我 欲望。 欢迎任何帮助。
谢谢
阿南特
I am trying to map my requests in a special way to achieve a very simple purpose.
Say the root website is abc.com
and has several users. Each user has a home page, admin page, requests page, etc.
Let us assume we have users user1
and user 2
I want the urls to be coded as:
abc.com/user1/admin
abc.com/user1/home
abc.com/user1/requests
So basically abc.com/user1/home
is the home page for user 1
and abc.com/user1/admin
is the the admin page for user 1.
I have tried using the request mapping in wicket using named parameters etc. I can encode my URL'S as abc.com/home/user1
but I can not get the encoding I desire.
Any help is welcome.
Thanks
Anant
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我刚刚开始使用 wicket 1.5 版本,但我认为新的映射系统将很容易地解决您的问题:
然后,在页面中您只需检索页面参数即可加载模型。
I'm just starting with the version 1.5 of wicket but I think the new mapping system will resolve your point quite easily :
Then, in the page you just have to retrieve the page parameter to load your model.