-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathController.java
More file actions
44 lines (34 loc) · 838 Bytes
/
Controller.java
File metadata and controls
44 lines (34 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package com.app.person;
import com.jk.web.faces.controllers.JKWebController;
import jakarta.faces.view.ViewScoped;
import jakarta.inject.Named;
@Named("controller")
@ViewScoped
public class Controller extends JKWebController{
private ServiceClient client = new ServiceClient();
private Person model;
public String sayHello() {
String msg=client.callSayHello();
success(msg);
return null;
}
public String sayHelloWithName() {
String msg=client.callSayHelloWithName(getModel().getName());
success(msg);
return null;
}
public String sayHelloWithObject() {
String msg=client.callSayHelloWithObject(getModel());
success(msg);
return null;
}
public Person getModel() {
if (model == null) {
model = new Person();
}
return model;
}
public void setModel(Person model) {
this.model = model;
}
}