t:dataList在JSF中导致重定向问题(java.lang.IllegalStateException)

t:dataList在JSF中导致重定向问题(java.lang.IllegalStateException),jsf,redirect,Jsf,Redirect,我试图编写简单的基于jsf的应用程序,但有一个问题我无法解决。我需要页面上的链接列表,所以我使用Tomahawk库中的t:dataList标记在页面上迭代输出它们 /list.jsp <f:view> <h:form> <t:dataList value="#{someBean.listOfNews}" var="news" > <h:commandLink value="edit" action="#{someBean.edit}">

我试图编写简单的基于jsf的应用程序,但有一个问题我无法解决。我需要页面上的链接列表,所以我使用Tomahawk库中的t:dataList标记在页面上迭代输出它们

/list.jsp

<f:view>
<h:form>
<t:dataList value="#{someBean.listOfNews}" var="news" >
<h:commandLink  value="edit" action="#{someBean.edit}">
        <f:setPropertyActionListener target="#{someBean.id}" value="#news.id}" />  
</h:commandLink>
</t:dataList>
</f:view>
</h:form>
但是如果我尝试不使用此标记,例如

<f:view>
<h:form>
<h:commandLink  value="edit" action="#{someBean.edit}">
        <f:setPropertyActionListener target="#{someBean.id}" value="1" />  
</h:commandLink><br>
<h:commandLink  value="edit" action="#{someBean.edit}">
        <f:setPropertyActionListener target="#{someBean.id}" value="2" />  
</h:commandLink>
</h:form>
</f:view>



它很好用。若我不在导航规则中使用标签,它也可以正常工作。有人能解释一下这个不兼容吗?t:dataList和redirect?

问题是我使用了tomahawk.jar的坏版本。现在我使用的是tomahawk20-1.1.10.jar,它运行得很好。

你是在使用JSF2.0吗?在脸上?您也可以使用
进行此操作。
java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:435)
at com.sun.faces.context.ExternalContextImpl.redirect(ExternalContextImpl.java:572)
at com.sun.faces.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:178)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:126)
at org.apache.struts.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:137)
at javax.faces.component.UICommand.broadcast(UICommand.java:311)
at javax.faces.component.UIData.broadcast(UIData.java:912)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:781)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1246)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:114)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:308)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Unknown Source)
<f:view>
<h:form>
<h:commandLink  value="edit" action="#{someBean.edit}">
        <f:setPropertyActionListener target="#{someBean.id}" value="1" />  
</h:commandLink><br>
<h:commandLink  value="edit" action="#{someBean.edit}">
        <f:setPropertyActionListener target="#{someBean.id}" value="2" />  
</h:commandLink>
</h:form>
</f:view>