資源簡介
Spring,hibernate,struts整合開發的實例,增刪改查,分頁,回顯的詳細代碼
代碼片段和文件信息
package?com.ssh.action;
import?java.util.Map;
import?org.apache.struts2.interceptor.RequestAware;
import?com.opensymphony.xwork2.ActionSupport;
import?com.opensymphony.xwork2.ModelDriven;
import?com.opensymphony.xwork2.Preparable;
import?com.ssh.entity.Component;
import?com.ssh.entity.Computer;
import?com.ssh.entity.Page;
import?com.ssh.service.ComponentService;
public?class?ComponentAction?extends?ActionSupport?implements?RequestAware?ModelDriven?Preparable?{
private?ComponentService?componentService;
private?Mapject>?request;
private?Component?model;
private?Integer?component_id;
private?int?page;
public?void?setPage(int?page)?{
this.page?=?page;
}
public?void?setComponent_id(Integer?component_id)?{
this.component_id?=?component_id;
}
public?void?setComponentService(ComponentService?componentService)?{
this.componentService?=?componentService;
}
@Override
public?void?setRequest(Mapject>?arg0)?{
this.request?=?arg0;
}
//?添加電腦配件
public?String?input()?{
request.put(“componentTypes“?componentService.getAllComponentType());
return?“input“;
}
//?得到所有
public?String?list()?{
Page?pagebean=componentService.getPages(5?page);
request.put(“pageBean“?pagebean);
return?“list“;
}
//?刪除
public?String?delete()?{
componentService.delete(component_id);
return?SUCCESS;
}
public?String?save()?{
componentService.saveOrUpdate(model);
return?SUCCESS;
}
public?void?prepareInput()?{
if?(component_id?!=?null)?{
model?=?componentService.get(component_id);
}
}
public?void?prepareSave()?{
if?(component_id?==?null)?{
model?=?new?Component();
}?else?{
model?=?componentService.get(component_id);
}
}
@Override
public?void?prepare()?throws?Exception?{
}
@Override
public?Component?getModel()?{
return?model;
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-07-14?11:03??DIY電腦配置\
?????目錄???????????0??2017-07-14?11:03??DIY電腦配置\ssh_computer\
?????文件????????4203??2017-07-12?20:56??DIY電腦配置\ssh_computer\.classpath
?????文件?????????912??2017-07-05?10:41??DIY電腦配置\ssh_computer\.project
?????目錄???????????0??2017-07-14?11:03??DIY電腦配置\ssh_computer\.settings\
?????文件?????????567??2017-07-05?10:41??DIY電腦配置\ssh_computer\.settings\.jsdtscope
?????文件?????????364??2017-07-05?10:41??DIY電腦配置\ssh_computer\.settings\org.eclipse.jdt.core.prefs
?????文件?????????563??2017-07-05?15:22??DIY電腦配置\ssh_computer\.settings\org.eclipse.wst.common.component
?????文件?????????305??2017-07-05?10:41??DIY電腦配置\ssh_computer\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件??????????49??2017-07-05?10:41??DIY電腦配置\ssh_computer\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件???????????6??2017-07-05?10:41??DIY電腦配置\ssh_computer\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????目錄???????????0??2017-07-14?11:03??DIY電腦配置\ssh_computer\WebContent\
?????目錄???????????0??2017-07-14?11:03??DIY電腦配置\ssh_computer\WebContent\me
?????文件??????????39??2017-07-05?10:41??DIY電腦配置\ssh_computer\WebContent\me
?????目錄???????????0??2017-07-14?11:03??DIY電腦配置\ssh_computer\WebContent\WEB-INF\
?????目錄???????????0??2017-07-14?11:03??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\
?????文件??????445288??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\antlr-2.7.7.jar
?????文件???????43578??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\asm-3.3.jar
?????文件???????38275??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\asm-commons-3.3.jar
?????文件???????21503??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\asm-tree-3.3.jar
?????文件??????610790??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\c3p0-0.9.1.2.jar
?????文件??????326877??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\com.springsource.net.sf.cglib-2.2.0.jar
?????文件????????4615??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\com.springsource.org.aopalliance-1.0.0.jar
?????文件?????1642154??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\com.springsource.org.aspectj.weaver-1.6.8.RELEASE.jar
?????文件???????68622??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\commons-fileupload-1.3.jar
?????文件??????159509??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\commons-io-2.0.1.jar
?????文件??????315805??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\commons-lang3-3.1.jar
?????文件???????62050??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\commons-logging-1.1.3.jar
?????文件??????313898??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\dom4j-1.6.1.jar
?????文件??????931168??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\freemarker-2.3.19.jar
?????文件???????81830??2017-06-21?11:07??DIY電腦配置\ssh_computer\WebContent\WEB-INF\lib\hibernate-commons-annotations-4.0.2.Final.jar
............此處省略100個文件信息
- 上一篇:avl cruise 教程
- 下一篇:最新大秀直播源碼全套-解密.rar
評論
共有 條評論