使用独特的页面映射创建页面
我有一个 wicket 应用程序,它的页面寿命很长。我希望使用唯一的 PageMap 创建此 PageMap 的每个实例,但当我尝试在我的 Page 的构造函数上指定 PageMap 时,我最终会收到 OOM 和 StackOverflow 错误。下面是代码:
public <CTOR>() {
super(Session.get().newPageMap("" + System.currentTimeMillis()));
...
我正在使用自定义 BookmarkablePageLink(自定义,因为它不会将当前 PageMap 名称传递给新页面)来有效地放弃旧的 Page/PageMap 并使用新的 PageMap 创建一个新的。这些错误似乎是在仅创建两三个页面后进行页面序列化造成的。
有人能发现这种方法有问题吗?
I have a wicket Application that has long lived Pages. I would like each instance of this Page to be created with a unique PageMap for reasons I won't get into here, but when I try to specify a PageMap on the constructor of my Page I end up getting OOM and StackOverflow errors. Here is the code:
public <CTOR>() {
super(Session.get().newPageMap("" + System.currentTimeMillis()));
...
I'm using a custom BookmarkablePageLink (custom in that it does not pass on the current PageMap name to the new Page) to effectively abandon the old Page/PageMap and create a new one with a new PageMap. The errors seem to be coming from page serialization after only two or three pages have been created.
Can anyone find issue with this approach?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我怀疑反序列化将调用此构造函数,以便您获得比预期更多的 PageMap。
I suspect deserialization will be calling this constructor so that you're getting more PageMaps than you expect.
我认为如果您在 中提出此类问题,您会得到更好的答案
wicket 用户邮件列表。邮件列表非常活跃,核心开发人员都会回复
大多数问题。
I think you will get better anwers if you ask this type of questions in the
wicket user mailing list. The mailing list is very active and the core developers will answer
most of the questions.