Skip to content
Snippets Groups Projects
Commit 7e9f7390 authored by Falucho's avatar Falucho
Browse files

Login and register FrontEnd

parent d45bc3f1
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,6 @@
<artifactId>wildfly-jsf</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
......
......@@ -21,8 +21,8 @@ import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@Named("faller")
@ViewScoped
@Named("faller")
public class RequestBean implements Serializable {
private static final long serialVersionUID = 4465735311570405045L;
......@@ -103,3 +103,6 @@ public class RequestBean implements Serializable {
this.mensaje = mensaje;
}
}
package uy.edu.fing.tse.jsf;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import java.io.Serializable;
@RequestScoped
@Named("userLoginView")
public class UserLoginBean implements Serializable {
private static final long serialVersionUID = -7674319505640122631L;
private String username;
private String password;
private String repassword;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRepassword() {
return repassword;
}
public void setRepassword(String repassword) {
this.repassword = repassword;
}
public void login() {
//aca va el login
}
public void register() {
//aca va el register
}
}
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
>
<body>
<ui:decorate template="/WEB-INF/templates/template.xhtml">
<ui:define name="contenido">
<h:form>
<h1>LOGIN</h1>
<h:panelGrid columns="2" cellpadding="5" id="form">
<h:outputLabel for="username" value="Username:"/>
<p:inputText id="username" value="#{userLoginView.username}" required="true" label="username"/>
<h:outputLabel for="password" value="Password:"/>
<p:password id="password" value="#{userLoginView.password}" required="true" label="password"/>
<f:facet name="footer">
<p:commandButton value="Register" action="register.xhmtl?faces-redirect=true" update="form"/>
<p:commandButton value="Login" action="#{userLoginView.login}"/>
</f:facet>
</h:panelGrid>
</h:form>
</ui:define>
</ui:decorate>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
>
<body>
<ui:decorate template="/WEB-INF/templates/template.xhtml">
<ui:define name="contenido">
<h:form>
<h1>Register</h1>
<h:panelGrid columns="2" cellpadding="5" id="form">
<h:outputLabel for="username" value="Username:"/>
<p:inputText id="username" value="#{userLoginView.username}" required="true" label="username"/>
<h:outputLabel for="password" value="Password:"/>
<p:password id="password" value="#{userLoginView.password}" required="true" label="password"/>
<h:outputLabel for="repassword" value="RePassword:"/>
<p:password id="repassword" value="#{userLoginView.repassword}" required="true" label="repassword"/>
<f:facet name="footer">
<p:commandButton value="Register" action="#{userLoginView.register}"/>
</f:facet>
</h:panelGrid>
</h:form>
</ui:define>
</ui:decorate>
</body>
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment