标题几乎说明了一切。我有一个名为login.jsp的页面:
<f:view>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=windows-1250"/>
<title>Bejelentkezés</title>
<!--<script language="JavaScript" src="login.js" type="text/javascript"></script>-->
</head>
<body>
<h:form>
<h:messages/>
<p>
Urán Tanulmányi Rendszer
</p>
<p>
Login: <h:inputText binding="#{backing_admin.loginLoginInput}"
id="loginLoginInput"/>
</p>
<p>
Jelszó: <h:inputSecret binding="#{backing_admin.loginPasswordInput}"
id="loginPasswordInput"/>
</p>
<p>
<h:commandButton value="Bejelentkezés"
binding="#{backing_admin.loginLoginButton}"
id="loginLoginButton"
action="#{backing_admin.loginAction}"/>
</p>
</h:form>
</body>
</html>
</f:view>
<%-- oracle-jdev-comment:auto-binding-backing-bean-name:backing_admin--%>
以及一些导航规则:
<faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
<managed-bean>
<managed-bean-name>backing_admin</managed-bean-name>
<managed-bean-class>hu.elte.pgy2.BACNAAI.view.backing.BackingAdmin</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<!--oracle-jdev-comment:managed-bean-jsp-link:1admin.jsp-->
<!--oracle-jdev-comment:managed-bean-jsp-link:1login.jsp-->
</managed-bean>
<navigation-rule>
<from-view-id>/login.jsp</from-view-id>
<navigation-case>
<from-action>#{backing_admin.loginAction}</from-action>
<from-outcome>"ADMIN"</from-outcome>
<to-view-id>/admin.jsp</to-view-id>
<redirect/>
</navigation-case>
<navigation-case>
<from-action>#{backing_admin.loginAction}</from-action>
<from-outcome>"STUDENT"</from-outcome>
<to-view-id>/student.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
</faces-config>
单击login.jsp上的按钮调用支持bean中的操作,该操作返回它应该的值,但是我被重定向回login.jsp而不是导航规则中定义的页面。什么可能导致这种情况发生?
答案 0 :(得分:3)
将"ADMIN"
ADMIN
替换为"STUDENTS"
STUDENTS
在导航案例中删除"