首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PrettyFaces在Wildfly 8.1.0中失败,但在8.0.0中有效

PrettyFaces在Wildfly 8.1.0中失败,但在8.0.0中有效
EN

Stack Overflow用户
提问于 2014-08-05 05:22:15
回答 2查看 644关注 0票数 0

当应用程序部署在Wildfli8.1.0.Final上时,PrettyFaces会在涉及重定向的每个请求上终止会话。同样的应用程序在Wildflig8.0上部署并正常工作。

在8.1.0中,PrettyFaces似乎阻止servlet堆栈撤回会话ID。

在这两种情况下,日志都没有显示异常。URL重写发生,但是会话信息(包括登录信息)消失了。这是我的漂亮的-config.xml

代码语言:javascript
复制
<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都会发生故障。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-08-27 15:31:31

正如肯所指出的,潜在的问题与https://issues.jboss.org/browse/WFLY-3448有关。

向web.xml添加显式cookie路径可以解决这个问题,并且是安全的。

代码语言:javascript
复制
<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可能会出现问题。

票数 2
EN

Stack Overflow用户

发布于 2014-08-26 15:23:54

这是WildFly 8.1.0中的一个bug,在这里介绍:https://issues.jboss.org/browse/WFLY-3448

在修复了该bug的版本之后,您将需要使用重写3.0.0.Alpha3或更高版本来解决处理根上下文路径的其他问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25131670

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档