问题描述
我正在将我的应用程序从PrimeFaces 3.5.18 + Mojarra 2.1.26移植到PrimeFaces 4.0.2 + Mojarra 2.2.4.
I'm porting my applications from PrimeFaces 3.5.18 + Mojarra 2.1.26 to PrimeFaces 4.0.2 + Mojarra 2.2.4.
重新启动服务器时,出现ViewExpiredException.
When I restart the server I get a ViewExpiredException.
服务器日志包含以下内容:ERROR: MAC did not verify!
Server log contains this: ERROR: MAC did not verify!
我知道默认情况下,MyFaces会生成一个随机密码来对视图状态进行编码,因此,每次服务器重新启动时,都会生成一个新的随机密码. Mojarra 2.2的行为方式是否相同?
I know that by default MyFaces generates a random secret to encode the view state, so each time the server restart, a new random secret is generated. Is Mojarra 2.2 behaving the same way?
在这种情况下,我需要设置哪些上下文参数?我最能找到的关于Mojarra 2.2上下文参数的谷歌搜索是这,但是没有MyFaces中的SECRET或MAC_SECRETS参数
In that case, what context parameters do I need to set? Googling for Mojarra 2.2 context parameters the best I could find was this, but there are no SECRET or MAC_SECRETS parameters like in MyFaces
预先感谢,菲利普
推荐答案
问题是这样的: https: //java.net/jira/browse/JAVASERVERFACES-2553
通过将状态保存方法更改为服务器来解决.
Solved it by changing the state saving method to server.
这篇关于JSF:Mojarra 2.1到2.2的迁移导致ViewExpiredException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!