use*_*895 4 jsessionid jsf-2 omnifaces
我在Tomcat7和JSF 2.1中使用OmniFaces FullAjaxExceptionHandler来处理ViewExpiredException.我设置了与OmniFaces展示相同的错误页面.在这里查看错误页面,这里是模板.
它工作正常.当会话过期时,我最终会出现expired.xhtml错误页面.但是,当我单击错误页面中的以下链接时,
<p><a href="#{requestScope['javax.servlet.error.request_uri']}">Back to initial page.</a></p>
Run Code Online (Sandbox Code Playgroud)
然后我得到以下异常:
com.sun.faces.mgbean.ManagedBeanCreationException: An error occurred performing resource injection on managed bean
Run Code Online (Sandbox Code Playgroud)
这不是一个大问题.无论如何,我需要一个将用户指向主页的按钮.所以我用下面的按钮替换它:
<h:button value="Home" outcome="logout" />
Run Code Online (Sandbox Code Playgroud)
以及此导航案例:
<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>
Run Code Online (Sandbox Code Playgroud)
导航将我带到了正确的页面,但会话ID显示在URL中:
https://localhost/stdPortal/index.xhtml;jsessionid=B68784B4ED8882A6575A2EE4012AF1B5
Run Code Online (Sandbox Code Playgroud)
我不想要这个.我怎么摆脱它?我希望网址如下:
https://localhost/stdPortal/index.xhtml
Run Code Online (Sandbox Code Playgroud)
您可以jsessionid通过添加以下内容来删除URL中的路径片段web.xml:
<session-config>
<tracking-mode>COOKIE</tracking-mode>
</session-config>
Run Code Online (Sandbox Code Playgroud)
它基本上禁用URL重写.
| 归档时间: |
|
| 查看次数: |
3621 次 |
| 最近记录: |