File tree Expand file tree Collapse file tree 7 files changed +60
-2
lines changed Expand file tree Collapse file tree 7 files changed +60
-2
lines changed Original file line number Diff line number Diff line change 210
210
/HolaMundoJSF /target /
211
211
/ControlClientes /target /
212
212
/ManagedBeansJSF /target /
213
+ /BackingBeanJSF /target /
Original file line number Diff line number Diff line change 1
1
eclipse.preferences.version =1
2
2
encoding//src/main/java =UTF-8
3
3
encoding//src/main/resources =UTF-8
4
+ encoding//src/test/java =UTF-8
4
5
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
1
+ package beans .backing ;
2
+
3
+ import beans .model .Candidato ;
4
+ import javax .enterprise .context .RequestScoped ;
5
+ import javax .inject .Inject ;
6
+ import javax .inject .Named ;
7
+
8
+ @ Named
9
+ @ RequestScoped
10
+ public class VacanteForm {
11
+
12
+ @ Inject
13
+ private Candidato candidato ;
14
+
15
+ public void setCandidato (Candidato candidato ){
16
+ this .candidato = candidato ;
17
+ }
18
+
19
+ public String enviar (){
20
+ if (this .candidato .getNombre ().equals ("Brian" )){
21
+ return "exito" ;
22
+ }
23
+ else
24
+ return "fallo" ;
25
+ }
26
+ }
Original file line number Diff line number Diff line change 2
2
<beans xmlns =" http://xmlns.jcp.org/xml/ns/javaee"
3
3
xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4
4
xsi : schemaLocation =" http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
5
- bean-discovery-mode =" all" >
5
+ bean-discovery-mode =" all"
6
+ version =" 2.0" >
6
7
</beans >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html xmlns ="http://www.w3.org/1999/xhtml "
3
+ xmlns:h ="http://java.sun.com/jsf/html ">
4
+ < head >
5
+ < title > Exito</ title >
6
+ </ head >
7
+ < body >
8
+ < h:form >
9
+ Gracias #{candidato.nombre} por aplicar a la vacante
10
+ < br />
11
+ < h:commandLink action ="index "> Regresar</ h:commandLink >
12
+ </ h:form >
13
+ </ body >
14
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html xmlns ="http://www.w3.org/1999/xhtml "
3
+ xmlns:h ="http://java.sun.com/jsf/html ">
4
+ < head >
5
+ < title > Fallo</ title >
6
+ </ head >
7
+ < body >
8
+ < h:form >
9
+ Lo siento #{candidato.nombre}, no hay vacantes por el momento
10
+ < br />
11
+ < h:commandLink action ="index "> Regresar</ h:commandLink >
12
+ </ h:form >
13
+ </ body >
14
+ </ html >
Original file line number Diff line number Diff line change 13
13
< td > < h:message for ="nombre "> </ h:message > </ td >
14
14
</ tr >
15
15
</ table >
16
+ < h:commandButton action ="#{vacanteForm.enviar} " value ="Enviar " />
16
17
</ h:form >
17
18
</ body >
18
- </ html >
19
+ </ html >
You can’t perform that action at this time.
0 commit comments