Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.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
Jakarta ee 几秒钟后重定向到另一页_Jakarta Ee_Jsf 2_Primefaces - Fatal编程技术网

Jakarta ee 几秒钟后重定向到另一页

Jakarta ee 几秒钟后重定向到另一页,jakarta-ee,jsf-2,primefaces,Jakarta Ee,Jsf 2,Primefaces,我有一个允许编辑用户的页面,当用户点击“编辑”按钮时,我会将他重定向到另一个页面几秒钟,我想再次将他重定向到另一个页面,但这一次我会一劳永逸地将他重定向到另一个页面, 我尝试使用 但它不起作用 这是我的密码: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD

我有一个允许编辑用户的页面,当用户点击“编辑”按钮时,我会将他重定向到另一个页面几秒钟,我想再次将他重定向到另一个页面,但这一次我会一劳永逸地将他重定向到另一个页面, 我尝试使用

但它不起作用 这是我的密码:

 <?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./template_admin.xhtml">

            <ui:define name="content">
                <h:form id="form">

                            <p:panel id="panel" header="Confirmation" style="width: 400px;margin: auto;" >

                                <h:panelGrid columns="1">
                                    <h:outputText value="votre edition est sauvegardé avec succée"/>
                                    <h:outputText value="vous serez rediriger vers la page de la liste des utilisateurs dans quelques instants" />
                                    <p:poll interval="3" action="utilsateurs" />
                                </h:panelGrid>


                            </p:panel>

                        </h:form>

            </ui:define>

        </ui:composition>

    </body>
</html>

你知道吗
提前谢谢你

你不需要投票。你可以用普通的html来完成。将此标记添加到页面的页眉

<meta http-equiv="refresh" content="5;URL=otherUrl.jsf" />


这将在5秒后重定向到“otherUrl.jsf”。由于您使用的是模板,也许您可以在标题中添加ui:insert,这样您就可以从模板客户端将meta插入标题中。

您不需要轮询。你可以用普通的html来完成。将此标记添加到页面的页眉

<meta http-equiv="refresh" content="5;URL=otherUrl.jsf" />


这将在5秒后重定向到“otherUrl.jsf”。由于您使用的是模板,也许您可以在页眉中添加一个ui:insert,这样您就可以从模板客户端将meta插入页眉中。

谢谢您的回复,但正如您所看到的,我使用的是facelet template和facelet template client,我在这一页中没有页眉,我只有脸上的h:头template@user1581868这正是为什么我告诉你在模板的标题中添加一个ui:insert,在模板客户端,你使用ui:include并将meta标记放在其中好的,你是对的,我没有注意到这一点,谢谢你感谢你的回复,但是正如你所看到的,我使用facelet模板和facelet模板客户端,我在这个页面中没有头,我在facelet中只有h:headtemplate@user1581868这就是为什么我告诉你在模板的头中添加一个ui:insert,在模板客户机中,使用ui:include并将meta标记放在其中好的,你是对的,我没有注意到这一点,谢谢