简体   繁体   English

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

[英]Wicket: stateless AJAX behaviors in stateful page without serialization

I have pretty stateful page with plenty of AJAX components. 我有很多AJAX组件的状态页面。 Most of these components have behaviors, which renders JavaScript code for calling AJAX requests to Java code. 这些组件中的大多数都有行为,这些行为呈现了JavaScript代码,用于将AJAX请求调用为Java代码。 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. 但是其中一些AJAX请求永远不会更改页面,因此不需要页面的序列化。 For example it is forward caching data for (home-brewed) datagrid component. 例如,它是用于(自酿)datagrid组件的正向缓存数据。 These requests are calling continuously and serialization of page during each request causes delays. 这些请求正在连续调用,并且在每个请求期间页面的序列化都会导致延迟。

There are some projects for stateless wicket components out there, eg wicket-stateless , but it solves another situation -- request of stateless components are processed on new instances of stateless pages. 有一些针对无状态wicket组件的项目,例如wicket-stateless ,但是它解决了另一种情况-对无状态组件的请求在新的无状态页面实例上处理。 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. 我已经尝试在自己的RequestCycleProcessor.resolve()实现此功能,但是由于Session.getPage()总是接触页面并且在请求处理后导致序列化 ,因此我一直在从requestParameters搜索页面。

  • Is there any example, idea, whatever for implementing this in Wicket? 是否有任何示例,想法,无论如何在Wicket中实现?

Hope it's understandable :) 希望这是可以理解的:)

这在wicket上有很深的介绍,您可能需要考虑在邮件列表( http://wicket.apache.org/community.html#Community-Mailinglists )上进行询问

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM