Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Primefaces 5.1处理来自AJAX请求的ViewExpiredException_Ajax_Jsf_Jsf 2_Primefaces_Viewexpiredexception - Fatal编程技术网

使用Primefaces 5.1处理来自AJAX请求的ViewExpiredException

使用Primefaces 5.1处理来自AJAX请求的ViewExpiredException,ajax,jsf,jsf-2,primefaces,viewexpiredexception,Ajax,Jsf,Jsf 2,Primefaces,Viewexpiredexception,我有一个JSF2.1+PrimeFaces5.1Web应用程序,我想处理ViewExpiredExceptions。除了web.xml中的配置(通过将异常映射到一个位置)之外,我认为我们需要在ajax请求期间抛出这些异常时处理它们 Primefaces为此提供了一个。我尝试使用它,尽管我可以看到服务器日志中抛出了异常,但我无法执行其他任何操作。也许我用错了。例如,当出现这种异常时,我如何将用户发送到index.xhtml页面,刷新所有ajax组件 我在faces-config.xml中定义了异常

我有一个JSF2.1+PrimeFaces5.1Web应用程序,我想处理
ViewExpiredException
s。除了web.xml中的配置(通过
将异常映射到一个位置)之外,我认为我们需要在ajax请求期间抛出这些异常时处理它们

Primefaces为此提供了一个
。我尝试使用它,尽管我可以看到服务器日志中抛出了异常,但我无法执行其他任何操作。也许我用错了。例如,当出现这种异常时,我如何将用户发送到
index.xhtml
页面,刷新所有ajax组件

我在faces-config.xml中定义了异常处理程序工厂:


org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory
并在我的模板页面中声明facelets处理程序:


以下是我对这些异常的web.xml配置:


javax.faces.application.ViewExpiredException
/index.xhtml
在这种方法失败后,我尝试了异常处理程序()的显式定义,但也没有成功

有人能告诉我如何解决这个问题吗?(我试图坚持使用普通JSF和Primefaces,尽管我知道Omnifaces提供了与Primefaces类似的解决方案,但我还没有尝试过)