tapestry4的页面属性persistent

Tapestry defines two basic types of property persistence. The type of persistence (internally known as the property persistence strategy ) is defined by the value of the persist attribute (in the <property> element). Omitting the persist attribute, or not providing a <property> element, indicates a transient page property, one which does not persist from request to request.

client
Client properties are stored on the client, in the form of query parameters. All persistent properties for each page are encoded into a single query parameter, named state: PageName . (每个页面所有的持久化属性被编码到一个单独的查询参数中,名字为 state:pageName)The query parameter value is a MIME encoded byte stream. This can get quite long if there are many client persistent properties on the page ... which may quickly run into limitations on the maximum size of a URL (approximately 4000 characters is a good guideline)( 注:可能达到URL最大长度的限制). This is less a problem for forms.

In Tapestry 4.0 the concept of a scope was introduced, specifying how long a property will persist. For client there exist two scopes: page and app. If you omit the scope it will default to client:page. (默认是client:page)

client:page

Persisted properties will be available until another page is activated and rendered.

client:app

Persisted properties will always be available.

session
The traditional style of property persistence (and the only kind available in Tapestry 3.0 and earlier). Each persistent property is mapped to a HttpSession attribute.

More such stategies are expected; these will give more control over the lifecycle of the page property.

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值