Jsf 清除SpringWebFlow中的表单

Jsf 清除SpringWebFlow中的表单,jsf,spring-webflow,Jsf,Spring Webflow,有人能帮我在数据保存到数据库后如何清除表单中的数据吗 add.xhtml <ui:define name="content"> <h2 style="font-weight:bold;font-size:16px;margin-top:10px;">Register a new employee</h2> <p:panel header="Add a Employee" toggleable="true

有人能帮我在数据保存到数据库后如何清除表单中的数据吗

   add.xhtml

       <ui:define name="content">

       <h2 style="font-weight:bold;font-size:16px;margin-top:10px;">Register a new employee</h2>
       <p:panel header="Add a Employee" toggleable="true" toggleSpeed="100">
    <h:form style="background: 10px steelBlue;border-radius: 13px;">

        <h:panelGrid columns="3" id="leaveform" >
        <div>
        <div>
        <h:outputLabel for="employee">Select the Type employee</h:outputLabel>
        <h:selectOneMenu id="approveleavetype" value="#{userInfo.loginperson}" required="false" >
                        <f:selectItems value="#{referenceData.loginPersonType}"/>
                    </h:selectOneMenu> 
            </div>
                 <h:outputLabel for="firstname">First Name<em>*</em></h:outputLabel>



                <h:inputText id="firstname" value="#{userInfo.fname}" 
                 required="true" 
                label="fname" style="background-color:#FFF;">
            </h:inputText>


            <div>

                <h:outputLabel for="lastName">Last Name<em>*</em></h:outputLabel>



                    <h:inputText id="lastname" value="#{userInfo.lname}" 
                 required="true" 
                label="lname" style="background-color:#FFF;">
            </h:inputText>


            </div>
            <div>
                <h:outputLabel for="emailId">Email Id<em>*</em></h:outputLabel>



                    <h:inputText id="emailId" value="#{userInfo.emailId}" 
                 required="true" 
                label="emailId" style="background-color:#FFF;">
            </h:inputText>

            </div>
            <div>
                <h:outputLabel for="manager">Manager<em>*</em></h:outputLabel>



            <h:inputText id="manager" value="#{userInfo.manager}" 
                 required="true" 
                label="manager" style="background-color:#FFF;">
            </h:inputText>
            </div>

            <div>
                <h:outputLabel for="username">UserName<em>*</em></h:outputLabel>



            <h:inputText id="username" value="#{userInfo.username}" 
                 required="true" 
                label="username" style="background-color:#FFF;">
            </h:inputText>
            </div>
            <div>
                <h:outputLabel for="password">Password<em>*</em></h:outputLabel>



            <h:inputText id="password" value="#{userInfo.password}" 
                 required="true" 
                label="password" style="background-color:#FFF;" >
            </h:inputText>
            </div>






        <center><p:commandButton value="Add Employee" action="insertemployee" id="insertemployee" style="margin-left:250px;"/></center>
    </div>  
add.xhtml
登记新员工
选择employee类型
名字*
姓*
电子邮件Id*
经理*
用户名*
密码*

main-flow.xml

             <view-state id="addEmployee">
<on-entry>
<evaluate expression="leaveBo.getallUser()" result="viewScope.allUser"></evaluate>
</on-entry>
    <transition on="insertemployee" to="addEmployeeInfo"></transition>

</view-state>

    <action-state id="addEmployeeInfo">
    <evaluate
        expression="leaveBo.insertEmpolyee(userInfo.fname,userInfo.lname,userInfo.emailId,userInfo.manager,userInfo.loginperson,userInfo.username,userInfo.password)"></evaluate>
    <transition to="addEmployee"></transition>
</action-state>


在这里,一旦数据被输入,它就会被保存,一旦它被保存,它就会转换到同一页。问题是我输入的值没有被清除。

您已经用属性定义了输入字段,如
value=“#{userInfo.username}”
,所以我想您必须显式地清除
userInfo
或其属性,使这些字段为空

或者只为一个页面/视图定义一个“本地”模型bean。虽然我承认从未使用过JSF,但我不知道使用JSF时WebFlow到底是什么样子