Wicket:有状态页面中的无状态 AJAX 行为,无需序列化

发布于 2024-08-29 11:50:00 字数 655 浏览 5 评论 0原文

我有非常有状态的页面,其中包含大量 AJAX 组件。这些组件中的大多数都有行为,这些行为将用于调用 AJAX 请求的 JavaScript 代码呈现给 Java 代码。由于页面不是无状态的,因此每个请求都会导致页面序列化。到目前为止,一切都很好。

但其中一些 AJAX 请求永远不会更改页面,因此不需要页面序列化。例如,它是(自制)数据网格组件的前向缓存数据。这些请求连续调用,并且每个请求期间的页面序列化会导致延迟。

有一些无状态 wicket 组件的项目,例如 wicket-stateless,但是它解决了另一种情况——无状态组件的请求在无状态页面的新实例上处理。我想处理现有有状态页面实例上的请求,但不进行序列化。

我尝试在自己的 RequestCycleProcessor.resolve() 中实现此功能,但我坚持从 requestParameters 中搜索页面,因为 Session.getPage() 始终触摸页面它会在请求处理后导致序列化。

  • 有没有任何例子、想法等等可以在 Wicket 中实现这一点?

希望这是可以理解的:)

I have pretty stateful page with plenty of AJAX components. Most of these components have behaviors, which renders JavaScript code for calling AJAX requests to Java code. Because page isn't stateless, each request causes serialization of page. So far so good.

But some of these AJAX requests doesn't change page ever, so serialization of page isn't necessary. For example it is forward caching data for (home-brewed) datagrid component. These requests are calling continuously and serialization of page during each request causes delays.

There are some projects for stateless wicket components out there, e.g. wicket-stateless, but it solves another situation -- request of stateless components are processed on new instances of stateless pages. I want to process requests on existing stateful page instance but without serialization.

I have tried to implement this in my own RequestCycleProcessor.resolve(), but I hung on searching for page from requestParameters because Session.getPage() always touches page and it causes serialization after request processing.

  • Is there any example, idea, whatever for implementing this in Wicket?

Hope it's understandable :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烂人 2024-09-05 11:50:00

这对 wicket 来说相当深入,您可能需要考虑在邮件列表上询问它( http: //wicket.apache.org/community.html#Community-Mailinglists

This goes rather deeply into wicket, you might want to consider asking it on the mailinglists ( http://wicket.apache.org/community.html#Community-Mailinglists )

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文