Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.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

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
JSF<;h:命令按钮动作>;不起作用_Jsf_Jsf 2_Navigation - Fatal编程技术网

JSF<;h:命令按钮动作>;不起作用

JSF<;h:命令按钮动作>;不起作用,jsf,jsf-2,navigation,Jsf,Jsf 2,Navigation,在以下代码snippest中不起作用 bean(Employee.java):- JSF页面(删除employee.xhtml):- Faces-config.xml:- <managed-bean> <description>Employee navigation</description> <managed-bean-name>employee</managed-bean-name>

在以下代码snippest中不起作用

bean(Employee.java):-

JSF页面(删除employee.xhtml):-


Faces-config.xml:-

    <managed-bean>
      <description>Employee navigation</description>
      <managed-bean-name>employee</managed-bean-name>
      <managed-bean-class>erpJavaFiles.Employee</managed-bean-class>
      <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>

<navigation-rule>
        <from-view-id>/add-Employee.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/CRM.xhtml</to-view-id>
            <redirect/>
        </navigation-case>
        <navigation-case>
            <from-outcome>failure</from-outcome>
            <to-view-id>/home.xhtml</to-view-id>
            <redirect/>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/delete-employee.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success3</from-outcome>
            <to-view-id>/CRM.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>

员工导航
雇员
雇员
应用
/add-Employee.xhtml
成功
/CRM.xhtml
失败
/home.xhtml
/delete-employee.xhtml
成功3
/CRM.xhtml
第二条导航规则不起作用,但第一条导航规则起作用。
提前感谢。

您在
中拼错了
员工

/delete-employee.xhtml

您在
中拼错了
员工

/delete-employee.xhtml

-非常感谢再次检查。问题中的文件名仍然与
不匹配。您可能还需要修复大小写:
/delete Employee.xhtml
,但我不知道文件名是什么。-非常感谢再次检查。问题中的文件名仍然与
不匹配。您可能还需要修复大小写:
/delete Employee.xhtml
,但我不知道文件的名称。为什么您仍然使用
faces config.xml
方法?JSF2.0为托管bean和隐式导航提供了注释。无论如何,
操作
属性中缺少的EL
{}
也是一个“打字错误”,对吗?谢谢你的巴卢斯克。但是你提供的链接不起作用,请再次发送。页面已关闭。同时,请参阅全面的JSF教程。为什么您仍然使用
faces-config.xml
方法?JSF2.0为托管bean和隐式导航提供了注释。无论如何,
操作
属性中缺少的EL
{}
也是一个“打字错误”,对吗?谢谢你的巴卢斯克。但是你提供的链接不起作用,请再次发送。页面已关闭。同时,请参阅全面的固体JSF教程。
<h:form>
    <h:commandButton action="employee.deleteEmployee" type="submit" value="delete"/>
</h:form> 
    <managed-bean>
      <description>Employee navigation</description>
      <managed-bean-name>employee</managed-bean-name>
      <managed-bean-class>erpJavaFiles.Employee</managed-bean-class>
      <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>

<navigation-rule>
        <from-view-id>/add-Employee.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success</from-outcome>
            <to-view-id>/CRM.xhtml</to-view-id>
            <redirect/>
        </navigation-case>
        <navigation-case>
            <from-outcome>failure</from-outcome>
            <to-view-id>/home.xhtml</to-view-id>
            <redirect/>
        </navigation-case>
    </navigation-rule>

    <navigation-rule>
        <from-view-id>/delete-employee.xhtml</from-view-id>
        <navigation-case>
            <from-outcome>success3</from-outcome>
            <to-view-id>/CRM.xhtml</to-view-id>
        </navigation-case>
    </navigation-rule>
<from-view-id>/delete-employee.xhtml</from-view-id>