gpt4 book ai didi

java - Flash 范围和请求范围之间的区别

转载 作者:行者123 更新时间:2023-12-01 14:52:09 25 4
gpt4 key购买 nike

Flash Scope 和 View Scope 有什么区别?

有人可以举例说明吗?

问候,

最佳答案

Flash Scope From the DOC :

The Flash scope works exactly like the Session, but with two differences: data are kept for only one request the Flash cookie is not signed, making it possible for the user to modify it.

示例:

public static Result index() {
String message = flash("success");
if(message == null) {
message = "Welcome!";
}
return ok(message);
}

public static Result save() {
flash("success", "The item has been created");
return redirect("/home");
}

请求范围很简单,它仅针对特定请求而存在。

关于java - Flash 范围和请求范围之间的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14734063/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com