PrimeFaces でのセッション期限切れ後のリダイレクトの問題を処理するために omnifaces を使用しましたが、非常にうまく機能します。問題は、セッション タイムアウトが発生した後に再ログインしようとすると、ログイン ページに誘導され、次のエラーが表示されることです。
F5 をクリックするか、ページをリロードすると、エラーが消えて、homePage に移動します。問題は、セッションの有効期限が切れた後、ajax ボタンをクリックするとこのエラーが発生することです。その後、ログイン ページに移動します。ユーザー名/パスワードを入力してログインボタンをクリックすると、次のエラーが表示されます。
お役に立てれば幸いです。
Ajax レスポンス:
<partial-response><error><error-name>javax.faces.application.ViewExpiredException</error-name><error-message>viewId:/protected/kdsHome.xhtml - View /protected/kdsHome.xhtml could not be restored.</error-message><error-stacktrace>javax.faces.application.ViewExpiredException: viewId:/protected/kdsHome.xhtml - View /protected/kdsHome.xhtml could not be restored.
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:205)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
at tr.com.provus.common.jsf.servlet.DelegateFacesServlet.serviceInternal(DelegateFacesServlet.java:311)
at tr.com.provus.common.jsf.servlet.DelegateFacesServlet.service(DelegateFacesServlet.java:243)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at tr.com.provus.kds.common.jsf.NoCacheFilter.doFilter(NoCacheFilter.java:28)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:79)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at tr.com.provus.kds.common.jsf.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:17)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:304)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
</error-stacktrace><error-hostname>alperk</error-hostname><updateTitle>
Hata <span style="color: red;">{error-name}</span></updateTitle><updateBody>
<div>
<form id="j_idt469" name="j_idt469" method="post" action="/ProvusAtmLocationOptimization/faces/protected/kdsHome.xhtml" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="j_idt469" value="j_idt469" />
<div id="j_idt469:j_idt470" class="ui-tabs ui-widget ui-widget-content ui-corner-all ui-hidden-container ui-tabs-top"><ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" role="tablist"><li class="ui-state-default ui-tabs-selected ui-state-active ui-corner-top" role="tab" aria-expanded="true"><a href="#j_idt469:j_idt470:j_idt471">Mesaj</a></li><li class="ui-state-default ui-corner-top" role="tab" aria-expanded="false"><a href="#j_idt469:j_idt470:j_idt475">Ayrıntı</a></li></ul><div class="ui-tabs-panels"><div id="j_idt469:j_idt470:j_idt471" class="ui-tabs-panel ui-widget-content ui-corner-bottom" role="tabpanel" aria-hidden="false"><table>
<tbody>
<tr>
<td><label>Hata mesajı:</label></td>
<td><span style="font-size: 1.2em;color:navy;">{error-message}</span></td>
</tr>
</tbody>
</table>
</div><div id="j_idt469:j_idt470:j_idt475" class="ui-tabs-panel ui-widget-content ui-corner-bottom ui-helper-hidden" role="tabpanel" aria-hidden="true">
<div style="overflow: auto; height: 300px; width: 700px;">
{error-stacktrace}
</div></div></div><input type="hidden" id="j_idt469:j_idt470_activeIndex" name="j_idt469:j_idt470_activeIndex" value="0" autocomplete="off" /></div><script id="j_idt469:j_idt470_s" type="text/javascript">PrimeFaces.cw('TabView','widget_j_idt469_j_idt470',{id:'j_idt469:j_idt470',effectDuration:'normal'});</script>
</form>
</div></updateBody></error></partial-response>
faces-config.xml
:
<lifecycle>
<phase-listener>tr.com.provus.kds.security.AjaxTimeoutPhaseListener</phase-listener>
</lifecycle>
web.xml
:
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/login.xhtml</location>
</error-page>