Jsf ViewExpiredException重定向无法使用视图中的JSTL标记forEach
环境: 我有一个带有WildFly 10.0.0.Final的EAR应用程序。它有一个用于web应用程序的模块,该模块基于JSF Mojarra 2.2.12-jbossorg-2 20150729-1131(用户界面使用PrimeFaces 6,其他实用程序使用Omnifaces 2.5.1) 用例: 我的问题是视图过期。我将我的应用程序简化为一个包含问题的小bean/视图展示。用例非常简单:如果视图过期并且用户触发了一些操作,他应该被重定向到视图过期页面。我正在为此使用Omnifaces FullAjaxExceptionHandler 问题: 视图过期时重定向几乎在所有情况下都有效。但是,只要我在视图中使用JSTL标记,它就不再工作了。然后,HTTP请求在我的Chrome开发工具中只是有一个状态(失败),什么也没有发生 以下Bean/视图组合显示了问题: 查看:text.xhtmlJsf ViewExpiredException重定向无法使用视图中的JSTL标记forEach,jsf,jstl,Jsf,Jstl,环境: 我有一个带有WildFly 10.0.0.Final的EAR应用程序。它有一个用于web应用程序的模块,该模块基于JSF Mojarra 2.2.12-jbossorg-2 20150729-1131(用户界面使用PrimeFaces 6,其他实用程序使用Omnifaces 2.5.1) 用例: 我的问题是视图过期。我将我的应用程序简化为一个包含问题的小bean/视图展示。用例非常简单:如果视图过期并且用户触发了一些操作,他应该被重定向到视图过期页面。我正在为此使用Omnifaces F
<!DOCTYPE html>
<html lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head id="head">
<title>Test</title>
</h:head>
<h:body>
<h:form>
<p:commandButton action="#{TestBean.throwError()}" value="Throw" update=":test"/>
</h:form>
<h:panelGroup id="test">
Test
</h:panelGroup>
<c:forEach items="#{TestBean.list}" var="item">
#{item.toString()}
</c:forEach>
<p>
<input type="button" value="Invalidate session"
onclick="$.get('#{request.contextPath}/invalidatesession?#{now.time}', alert('Session invalidated!'))"/>
</p>
</h:body>
</html>
试验
试验
#{item.toString()}
Bean:Test.java
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.inject.Named;
import org.omnifaces.cdi.ViewScoped;
@ViewScoped
@Named(value = "TestBean")
public class Test implements Serializable
{
private static final long serialVersionUID = -6513676596620667863L;
private List<String> list = new ArrayList<>();
@PostConstruct
public void init()
{
this.list.add("aaaaa");
this.list.add("bbbbb");
this.list.add("ccccc");
}
public void throwError()
{
throw new IllegalArgumentException("bla");
}
public List<String> getList()
{
return this.list;
}
}
import java.io.Serializable;
导入java.util.ArrayList;
导入java.util.List;
导入javax.annotation.PostConstruct;
导入javax.inject.Named;
导入org.omnifaces.cdi.ViewScoped;
@视域
@命名(value=“TestBean”)
公共类测试实现可序列化
{
私有静态最终长serialVersionUID=-6513676596620667863L;
私有列表=新的ArrayList();
@施工后
公共void init()
{
本清单添加(“AAAA”);
本表添加(“BBB”);
本清单新增(“ccccc”);
}
公共空间投掷者()
{
抛出新的IllegalArgumentException(“bla”);
}
公共列表getList()
{
返回此.list;
}
}
这几乎是带有JSTL标记的Omnifaces的FullAjaxExceptionHandler示例。一旦我把它从我的视野中移开,一切都会好起来