Hi
Ich habe folgende Xhtml Seite:
[XML]
<!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:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<head>
<title>- Login</title>
</head>
<body>
<h1>Login</h1>
<h2>Bitte loggen Sie sich ein</h2>
<h:form id="form">
<hanelGrid id="grid" columns="2">
<hutputLabel value="Email:" for="email"/>
<h:inputText id="email"
value="#{user.email}"/>
<hutputLabel value="Password:" for="password"/>
<h:inputSecret id="password"
value="#{user.password}"/>
<hutputLabel value="Einloggen:" for="login"/>
<h:commandButton id="login" action="#{user.save}"
value="Login"/>
</hanelGrid>
</h:form>
</body>
</html>
[/XML]
und die dazugehörige ManagedBean
Beim Click auf dem Login-Button wird die Methode save() der Bean Customer ausgeführt, aber es wir nicht die Seite index.html aufgerufen. Sieht jemand den Fehler ?
Schöne Grüße
Arne
Ich habe folgende Xhtml Seite:
[XML]
<!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:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<head>
<title>- Login</title>
</head>
<body>
<h1>Login</h1>
<h2>Bitte loggen Sie sich ein</h2>
<h:form id="form">
<hanelGrid id="grid" columns="2">
<hutputLabel value="Email:" for="email"/>
<h:inputText id="email"
value="#{user.email}"/>
<hutputLabel value="Password:" for="password"/>
<h:inputSecret id="password"
value="#{user.password}"/>
<hutputLabel value="Einloggen:" for="login"/>
<h:commandButton id="login" action="#{user.save}"
value="Login"/>
</hanelGrid>
</h:form>
</body>
</html>
[/XML]
und die dazugehörige ManagedBean
Java:
package user;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
@ManagedBean
@SessionScoped
public class User {
String email;
String password;
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String save(){
System.out.println("User.save()");
return "/index.xhtml";
}
}
Beim Click auf dem Login-Button wird die Methode save() der Bean Customer ausgeführt, aber es wir nicht die Seite index.html aufgerufen. Sieht jemand den Fehler ?
Schöne Grüße
Arne