-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backing Bean en JSF Resolves: # see also:#
- Loading branch information
1 parent
50fac1c
commit 0581893
Showing
7 changed files
with
60 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,3 +210,4 @@ | |
/HolaMundoJSF/target/ | ||
/ControlClientes/target/ | ||
/ManagedBeansJSF/target/ | ||
/BackingBeanJSF/target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/main/java=UTF-8 | ||
encoding//src/main/resources=UTF-8 | ||
encoding//src/test/java=UTF-8 | ||
encoding/<project>=UTF-8 |
26 changes: 26 additions & 0 deletions
26
BackingBeanJSF/src/main/java/beans/backing/VacanteForm.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package beans.backing; | ||
|
||
import beans.model.Candidato; | ||
import javax.enterprise.context.RequestScoped; | ||
import javax.inject.Inject; | ||
import javax.inject.Named; | ||
|
||
@Named | ||
@RequestScoped | ||
public class VacanteForm { | ||
|
||
@Inject | ||
private Candidato candidato; | ||
|
||
public void setCandidato(Candidato candidato){ | ||
this.candidato = candidato; | ||
} | ||
|
||
public String enviar(){ | ||
if(this.candidato.getNombre().equals("Brian")){ | ||
return "exito"; | ||
} | ||
else | ||
return "fallo"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:h="http://java.sun.com/jsf/html"> | ||
<head> | ||
<title>Exito</title> | ||
</head> | ||
<body> | ||
<h:form> | ||
Gracias #{candidato.nombre} por aplicar a la vacante | ||
<br/> | ||
<h:commandLink action="index">Regresar</h:commandLink> | ||
</h:form> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:h="http://java.sun.com/jsf/html"> | ||
<head> | ||
<title>Fallo</title> | ||
</head> | ||
<body> | ||
<h:form> | ||
Lo siento #{candidato.nombre}, no hay vacantes por el momento | ||
<br/> | ||
<h:commandLink action="index">Regresar</h:commandLink> | ||
</h:form> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters