| 3 | import com.opensymphony.xwork2.ActionSupport; |
| 4 | |
| 5 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected