資源簡介
Struts2+Hibernate開發(fā)學生成績管理系統(tǒng)

代碼片段和文件信息
package?chao.action;
import?java.util.List;
import?java.util.Map;
import?chao.model.Cjb;
import?chao.model.CjbId;
import?chao.model.Kcb;
import?chao.model.Xsb;
import?chao.service.CjService;
import?chao.service.KcService;
import?chao.service.XsService;
import?chao.serviceimp.CjServiceImp;
import?chao.serviceimp.KcServiceImp;
import?chao.serviceimp.XsServiceImp;
import?chao.tool.Pager;
import?com.opensymphony.xwork2.ActionContext;
import?com.opensymphony.xwork2.ActionSupport;
public?class?CjAction?extends?ActionSupport{
????private?Cjb?cj;
????private?int?pageNow=1;
private?int?pageSize=8;?
public?int?getPageNow()?{
return?pageNow;
}
public?void?setPageNow(int?pageNow)?{
this.pageNow?=?pageNow;
}
public?int?getPageSize()?{
return?pageSize;
}
public?void?setPageSize(int?pageSize)?{
this.pageSize?=?pageSize;
}
public?Cjb?getCj()?{
return?cj;
}
public?void?setCj(Cjb?cj)?{
this.cj?=?cj;
}
XsService?xsService=new?XsServiceImp();
????KcService?kcService=new?KcServiceImp();
????CjService?cjService=new?CjServiceImp();
@Override
public?String?execute()?throws?Exception?{
//?TODO?Auto-generated?method?stub
List?list1=xsService.findAll(1?xsService.findXsSize());
List?list2=kcService.FindAll(1?kcService.findKcSize());
Map?request=(Map)?ActionContext.getContext().get(“request“);
request.put(“l(fā)ist1“?list1);
request.put(“l(fā)ist2“?list2);
return?SUCCESS;
}
public?String?addCj()?throws?Exception?{
String?xh=cj.getId().getXsb().getXh();
String?kch=cj.getId().getKcb().getKch();
if(cjService.getXsCj(xh?kch)!=null)
{
return?ERROR;
}
Cjb?cj1=new?Cjb();
CjbId?cjId=new?CjbId();
cjId.setXsb(cj.getId().getXsb());
cjId.setKcb(cj.getId().getKcb());
cj1.setId(cjId);
cj1.setCj(cj.getCj());
Kcb?kc1=kcService.find(cj.getId().getKcb().getKch());
if(cj.getCj()>60||cj.getCj()==60)
{
cj1.setXf(kc1.getXf());
}
else
cj1.setXf(0);
cjService.save(cj1);
return?SUCCESS;
}
public?String?xscjInfo()?throws?Exception?{
List?list=cjService.findAllCj(pageNow?pageSize);
Map?request=(Map)?ActionContext.getContext().get(“request“);
Pager?page=new?Pager(pageNow?cjService.findCjSize());
request.put(“l(fā)ist“?list);
request.put(“page“?page);
return?SUCCESS;
}
public?String?findXscj()?throws?Exception?{
List?list=cjService.getXsCjList(cj.getId().getXsb().getXh());
if(list.size()>0)
{
Map?request=(Map)?ActionContext.getContext().get(“request“);
request.put(“l(fā)ist“?list);
return?SUCCESS;
}
else
return?ERROR;
}
public?String?findCj()?throws?Exception?{
Cjb?stucj=cjService.getXsCj(cj.getId().getXsb().getXh()cj.getId().getKcb().getKch());
Map?request=(Map)?ActionContext.getContext().get(“request“);
request.put(“stucj“?stucj);
return?SUCCESS;
}
public?String?deleteCj()?throws?Exception?{
String?xh=cj.getId().getXsb().getXh();
String?kch=cj.getId().getKcb
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-12-04?23:32??student\
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\
?????文件????????2704??2011-01-02?11:58??student\xscj_chao\.classpath
?????目錄???????????0??2014-12-04?23:32??student\xscj_chao\.myeclipse\
?????文件?????????544??2011-01-02?11:58??student\xscj_chao\.myhibernatedata
?????文件?????????301??2011-01-02?12:05??student\xscj_chao\.myme
?????文件????????1617??2011-01-02?12:03??student\xscj_chao\.project
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\.settings\
?????文件?????????500??2011-01-02?11:58??student\xscj_chao\.settings\.jsdtscope
?????文件????????1040??2011-01-02?12:04??student\xscj_chao\.settings\com.genuitec.eclipse.j2eedt.core.prefs
?????文件?????????330??2011-01-02?11:58??student\xscj_chao\.settings\org.eclipse.jdt.core.prefs
?????文件??????????49??2011-01-02?11:58??student\xscj_chao\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2011-01-02?11:58??student\xscj_chao\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\WebRoot\
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\WebRoot\me
?????文件??????????36??2011-01-02?11:58??student\xscj_chao\WebRoot\me
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\WebRoot\WEB-INF\
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\WebRoot\WEB-INF\classes\
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\WebRoot\WEB-INF\classes\chao\
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\WebRoot\WEB-INF\classes\chao\action\
?????文件????????4987??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\action\CjAction.class
?????文件????????1352??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\action\DlAction.class
?????文件????????3413??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\action\KcAction.class
?????文件????????5717??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\action\XsAction.class
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\WebRoot\WEB-INF\classes\chao\dao\
?????文件?????????517??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\dao\CjDao.class
?????文件?????????251??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\dao\DlDao.class
?????文件?????????317??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\dao\KcDao.class
?????文件?????????317??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\dao\XsDao.class
?????文件?????????234??2011-01-02?12:03??student\xscj_chao\WebRoot\WEB-INF\classes\chao\dao\ZyDao.class
?????目錄???????????0??2014-12-04?23:01??student\xscj_chao\WebRoot\WEB-INF\classes\chao\daoimp\
............此處省略171個文件信息
評論
共有 條評論