我目前在Websphere 8.0上使用JSF编程,遇到了一个问题,我认为这是因为我们的集群。我们有两个节点,其中一个停机了一段时间后,我的问题没有发生。
我的问题是,我通过commandButton提交后,以javax.faces.application.ViewExpiredException结尾。
另外,在此之前的堆栈跟踪中,我发现了以下内容:
View State cannot be reconstructed
javax.faces.FacesException: javax.faces.application.ViewExpiredException
at org.apache.myfaces.shared_impl.util.StateUtils.decrypt(StateUtils.java:496)
at org.apache.myfaces.shared_impl.util.StateUtils.reconstruct(StateUtils.java:378)
所以我猜这两个节点之间的处理有问题。
在我的web.xml中,我设置了:
<distributable />
和
<env-entry>
<env-entry-name>jsf/ClientSideSecretKey</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>SRe1FY2HKwBTOtT5KrtmiSoOzws+NA9/yX191wMFn9o=</env-entry-value>
</env-entry>
就像其他一些帖子中提到的一样,但我的问题仍然存在。
在Websphere中是否需要进行一些配置?
发布于 2017-02-22 01:15:43
这指向了一个加密问题。WebSphere 8.0使用MyFaces JSF2.0实现--您可能需要通过MyFaces上下文参数为每个节点配置一个共享密钥。您至少需要设置org.apache.myfaces.SECRET参数:
<!-- Defines the secret (Base64 encoded) used to initialize the secret key
for encryption algorithm. The size of it depends on the algorithm used for encryption -->
<context-param>
<param-name>org.apache.myfaces.SECRET</param-name>
<param-value>MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIz</param-value>
</context-param>
here是对MyFaces安全参数的说明。
https://stackoverflow.com/questions/42373360
复制相似问题