无状态Apache Wicket无状态页面/请求 [英] Stateless Apache Wicket stateless pages/requests

查看:154
本文介绍了无状态Apache Wicket无状态页面/请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在阅读Wicket标签下的另一个问题,比较 Apache Wicket Apache Click 。在我看来,这是一个简明的解释。我比Wicket世界更熟悉Click世界。

So I was reading another question under the Wicket tag comparing Apache Wicket and Apache Click. A concise explanation, in my opinion. I am more familiar with the Wicket world than the Click world.

我读到的一条评论是你可以制作无状态的Wicket页面。我开始考虑这个问题,无法找到一种方法来为无状态的东西发出请求或页面请求。在某些情况下,这肯定会派上用场。那么如何在没有状态的情况下开始使用Wicket?

One of the comments I read was that you can make stateless Wicket pages. I started to think about this and couldn't figure out a way to make a request or a page request for something stateless. This could certainly come in handy in some situations. So how does one start to use Wicket without state?

推荐答案

如果页面是可收藏的且不包含任何非无状态页面组件/行为然后页面自动无状态,不存储在会话中。我认为只要用户只访问无状态页面,就不会创建会话。在大多数情况下,如果关于如何显示页面的所有内容都可以仅通过no-args构造函数或采用PageParameters参数的构造函数来确定。普通的Link和Form类不是无状态的,所以你需要使用StatelessForm和StatelessLink。

If a page is bookmarkable and doesn't contain any non-stateless components/behaviors then the page is automatically stateless and not stored in the session. I think that as long as a user visits only stateless pages, a session will not be created. For the most part, if everything about how the page is displayed can be determined solely from a no-args constructor or a constructor taking a PageParameters argument. The normal Link and Form classes are not stateless, so you'll need to use StatelessForm and StatelessLink instead.

这篇关于无状态Apache Wicket无状态页面/请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆