level 2
胖子蹲里面
楼主
package com.inspur.controller;
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction extends ActionSupport {
private String username;
private String password;
@Override
public String execute() throws Exception {
if("sa".equals(this.username) && "123".equals(this.password)){
return "success";
}else{
return "error";
}
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
PS:java书中说set是设置;get是获得
按道理来讲不应该是先设置再获得吗
2013年03月31日 05点03分
1
import com.opensymphony.xwork2.ActionSupport;
public class LoginAction extends ActionSupport {
private String username;
private String password;
@Override
public String execute() throws Exception {
if("sa".equals(this.username) && "123".equals(this.password)){
return "success";
}else{
return "error";
}
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
PS:java书中说set是设置;get是获得
按道理来讲不应该是先设置再获得吗