日期:2014-05-17  浏览次数:20855 次

Struts2空值问题
package cn.jboa.action;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import cn.jboa.bean.*;
import cn.jboa.biz.emService;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class emAction extends ActionSupport{
private List<Employee> yong;
private emService ue;
private Employee lo;
private List<Department> de;
private List<Position> po;
private String de_id;
private String po_id;
Department dep=new Department();
Position pos=new Position();
private List<String> fs;
private int xiu_id;



public int getXiu_id() {
return xiu_id;
}
public void setXiu_id(int xiuId) {
xiu_id = xiuId;
}


public List<String> getFs() {
return fs;
}
public void setFs(List<String> fs) {
this.fs = fs;
}
public String getDe_id() {
return de_id;
}
public void setDe_id(String deId) {
de_id = deId;
}
public String getPo_id() {
return po_id;
}
public void setPo_id(String poId) {
po_id = poId;
}
public List<Department> getDe() {
return de;
}
public void setDe(List<Department> de) {
this.de = de;
}
public List<Position> getPo() {
return po;
}
public void setPo(List<Position> po) {
this.po = po;
}
public Employee getLo() {
return lo;
}
public void setLo(Employee lo) {
this.lo = lo;
}
public List<Employee> getYong() {
return yong;
}
public void setYong(List<Employee> yong) {
this.yong = yong;
}
public emService getUe() {
return ue;
}
public void setUe(emService ue) {
this.ue = ue;
}

/*
 * 登陆
 * */ 
public String login()
{
ActionContext  ch=ActionContext.getContext();


Employee em=ue.login(lo);
if(em!=null)
{

ch.getSession().put("yy", em);
// String str=em.getPOSITION_ID().getPOWER_ID().getNAME_QX();
// String []qquan=str.split("\\.");
// for(String te:qquan)
// {
// fs.add(te);
// System.out.println(te);
// }
//
// System.out.println(fs.size());
return SUCCESS;
}
else
{

return LOGIN;
}
}

  public List<String> xian()
{
System.out.println(fs.size());//我想在这里用这个fs但显示为0为什么呢高手帮帮忙啊。先谢谢了。
return fs;

}
SSH