MCPcopy Create free account
hub / github.com/Firebasky/Java / Struts001

Class Struts001

Struts2/Struts2-001/Struts001.java:5–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import com.opensymphony.xwork2.ActionSupport;
4
5public class Struts001 extends ActionSupport {
6 private String username;
7 private String password;
8
9
10 @Override
11 public String execute() throws Exception {
12 if ((this.username.isEmpty()) || (this.password.isEmpty())) {
13 return "error";
14 }
15 if ((this.username.equalsIgnoreCase("admin"))
16 && (this.password.equals("admin"))
17 ) {
18 return "success";
19 }
20 return "error";
21
22 }
23 public void setPassword(String password) {
24 this.password = "%{1+1}";
25 }
26
27 public String getPassword() {
28 return password;
29 }
30
31 public String getUsername() {
32 return username;
33 }
34
35 public void setUsername(String username) {
36 this.username = username;
37 }
38}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected