当应用程序部署在Wildfli8.1.0.Final上时,PrettyFaces会在涉及重定向的每个请求上终止会话。同样的应用程序在Wildflig8.0上部署并正常工作。
在8.1.0中,PrettyFaces似乎阻止servlet堆栈撤回会话ID。
在这两种情况下,日志都没有显示异常。URL重写发生,但是会话信息(包括登录信息)消失了。这是我的漂亮的-config.xml
<pretty-config xmlns="http://ocpsoft.org/schema/rewrite-config-prettyfaces"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ocpsoft.org/schema/rewrite-config-prettyfaces
http://ocpsoft.org/xml/ns/prettyfaces/rewrite-config-prettyfaces.xsd">
<url-mapping id="user-settings">
<pattern value="/protected/user/settings/"/>
<view-id value="/protected/usersettings.xhtml"/>
</url-mapping>
<url-mapping id="thread-edit">
<pattern value="/protected/threads/edit/#{stitchId}/" />
<view-id value="/protected/threads/stitch.xhtml" />
<action>#{stitchEditBean.editStitchFromId(stitchId)}</action>
</url-mapping>
<url-mapping id="threads-index">
<pattern value="/protected/threads/" />
<view-id value="/protected/threads/index.xhtml" />
</url-mapping>
</pretty-config>PrettyFaces 2.0.12.Final和3.0.0.Alpha2都会发生故障。
发布于 2014-08-27 15:31:31
正如肯所指出的,潜在的问题与https://issues.jboss.org/browse/WFLY-3448有关。
向web.xml添加显式cookie路径可以解决这个问题,并且是安全的。
<session-config>
<session-timeout>30</session-timeout>
<cookie-config>
<!--
A bug in wildfly 8.1.0.final requires this path to be set explicitly or occasionally the default is
incorrect and the system will generate one cookie per directory incorrectly.
-->
<path>/</path>
</cookie-config>
</session-config>您可能需要手动清除应用程序每个目录中的坏cookie,或者刷新所有会话cookie。否则,旧的会话cookie可能会出现问题。
发布于 2014-08-26 15:23:54
这是WildFly 8.1.0中的一个bug,在这里介绍:https://issues.jboss.org/browse/WFLY-3448
在修复了该bug的版本之后,您将需要使用重写3.0.0.Alpha3或更高版本来解决处理根上下文路径的其他问题。
https://stackoverflow.com/questions/25131670
复制相似问题