gpt4 book ai didi

jsf-2 - 使用 h :button 时去掉 URL 中的 ;jsessionid=xxx 路径参数

转载 作者:行者123 更新时间:2023-12-04 23:03:27 25 4
gpt4 key购买 nike

我正在使用 OmniFaces FullAjaxExceptionHandler 在 Tomcat7 和 JSF 2.1 中处理 ViewExpiredException .我已经设置了与 OmniFaces 展示相同的错误页面。 Look here for error pageshere for template .

它工作正常。当 session 过期时,我最终会进入 expired.xhtml错误页面。但是,当我单击错误页面中的以下链接时,

 <p><a href="#{requestScope['javax.servlet.error.request_uri']}">Back to initial page.</a></p>

然后我得到以下异常:
com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection on managed bean 

这不是什么大问题。无论如何,我需要一个将用户指向主页的按钮。所以我用下面的按钮替换了它:
<h:button value="Home" outcome="logout" />

连同这个导航案例:
<navigation-rule>
<from-view-id>*</from-view-id>
<navigation-case>
<from-outcome>logout</from-outcome>
<to-view-id>/stdPortal/index.xhtml</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>

导航将我带到了正确的页面,但是 session ID 出现在 URL 中:
https://localhost/stdPortal/index.xhtml;jsessionid=B68784B4ED8882A6575A2EE4012AF1B5

我不要这个。我该如何摆脱它?我希望 URL 是这样的:
https://localhost/stdPortal/index.xhtml

最佳答案

你可以摆脱jsessionid将以下内容添加到 URL 中的路径片段 web.xml :

<session-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>

它基本上禁用 URL-rewriting .

关于jsf-2 - 使用 h :button 时去掉 URL 中的 ;jsessionid=xxx 路径参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17346871/

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