日期:2014-05-19 浏览次数:20577 次
package cn.jbit.jboa.entity;
/**
* 员工 实体类。
* @author
* @version
*/
public class Employee implements java.io.Serializable {
// Fields
private static final long serialVersionUID = 5106663630382037556L;
private String sn;
private Position position;
private Department department;
private String password;
private String name;
private String status;
// Constructors
/** default constructor */
public Employee() {
}
public Employee(String sn, Position position, Department department,
String password, String name, String status) {
super();
this.sn = sn;
this.position = position;
this.department = department;
this.password = password;
this.name = name;
this.status = status;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public Position getPosition() {
return position;
}
public void setPosition(Position position) {
this.position = position;
}
public Department getDepartment() {
return department;
}
public void setDepartment(Department department) {
this.department = department;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
<s:form action="login">
<s:textfield name="employee.name" label="用户名" />
<s:textfield name="employee.sn" label="编码" value="12345"/>
<s:password name="employee.password" label="密码" />
<input type="hidden" name="employee.status" value="...stat..."/>
<s:submit value="登录"></s:submit>
</s:form>
package cn.jbit.jboa.action;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import cn.jbit.jboa.constants.Constants;
import cn.jbit.jboa.entity.ClaimVoucher;
import cn.jbit.jboa.entity.Department;
import cn.jbit.jboa.entity.Employee;
import cn.jbit.jboa.entity.Position;
import cn.jbit.jboa.service.EmployeeService;
impo