資源簡介
一、 項目名稱:S2316S411H436
項目原型:Struts2.3.16 + Spring4.1.1 + Hibernate4.3.6
二、 項目目的:
整合使用最新版本的三大框架(即Struts2、Spring4和Hibernate4),搭建項目架構原型。
項目架構原型:Struts2.3.16 + Spring4.1.1 + Hibernate4.3.6。
此外,還有:log4j、slf4j、junit4、ehcache等知識點。
項目特色:
同時使用了Struts2、Spring4、Hibernate4、log4j、slf4j、junit4、ehcache等庫或框架,搭建一個最基本的項目原型。
三、 三大框架最新版本下載:截止2014-10-01
Struts2.3.6:發布于2014-05-03,目前的最新版本。官網:http://struts.apache.org/
http://mirrors.cnnic.cn/apache/struts/binaries/struts-2.3.16.3-all.zip
Spring4.1.1:發布于2014-10-01,目前的最新版本。官網:http://spring.io/
http://repo.spring.io/libs-release-local/org/springframework/spring/4.1.1.RELEASE/spring-framework-4.1.1.RELEASE-dist.zip
Hibernate4.3.6:發布于2014-07-16,目前的最新版本。官網:http://hibernate.org/
http://softlayer-sng.dl.sourceforge.net/project/hibernate/hibernate4/4.3.6.Final/hibernate-release-4.3.6.Final.zip
代碼片段和文件信息
package?com.hysd.action;
import?javax.annotation.Resource;
import?javax.servlet.http.HttpServletRequest;
import?org.apache.struts2.ServletActionContext;
import?org.springframework.stereotype.Controller;
import?com.hysd.domain.Emp;
import?com.hysd.service.EmpService;
import?com.opensymphony.xwork2.ActionSupport;
@Controller
public?class?LoginAction?extends?ActionSupport?{
private?static?final?long?serialVersionUID?=?1L;
@Resource
private?EmpService?empService;
private?String?empname;
private?String?password;
public?String?login()?{
System.out.println(“提交的請求參數如下:“);
System.out.println(“empname:“?+?empname);
System.out.println(“password:“?+?password);
int?eid?=?0;
try?{
eid?=?Integer.parseInt(empname);
}?catch?(Exception?ex)?{
}
Emp?emp?=?empService.findEmpById(eid);//?為了測試結果,這里寫死了
if?(emp?!=?null)?{
System.out.println(“根據主鍵ID查詢記錄:查到了,查詢成功!“);
System.out.println(emp.toString());
HttpServletRequest?request?=?ServletActionContext.getRequest();//?在Struts2的Action中獲取Servlet的原生API
request.setAttribute(“empname“?emp.getEname());
return?SUCCESS;
}?else?{
System.out.println(“根據主鍵ID查詢記錄:沒查到,查詢失敗,記錄不存在!“);
return?“failure“;
}
}
public?String?getEmpname()?{
return?empname;
}
public?void?setEmpname(String?empname)?{
this.empname?=?empname;
}
public?String?getPassword()?{
return?password;
}
public?void?setPassword(String?password)?{
this.password?=?password;
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????5530??2014-10-14?21:37??S2316S411H436\.classpath
?????文件???????1338??2014-10-12?15:20??S2316S411H436\.project
?????文件????????522??2014-09-24?22:07??S2316S411H436\.settings\.jsdtscope
?????文件???????1009??2014-10-12?15:20??S2316S411H436\.settings\com.genuitec.eclipse.j2eedt.core.prefs
?????文件????????598??2014-10-12?15:21??S2316S411H436\.settings\org.eclipse.jdt.core.prefs
?????文件????????566??2014-10-12?15:20??S2316S411H436\.settings\org.eclipse.wst.common.component
?????文件????????398??2014-09-24?22:07??S2316S411H436\.settings\org.eclipse.wst.common.project.facet.core.xm
?????文件?????????49??2014-09-24?22:07??S2316S411H436\.settings\org.eclipse.wst.jsdt.ui.superType.container
?????文件??????????6??2014-09-24?22:07??S2316S411H436\.settings\org.eclipse.wst.jsdt.ui.superType.name
?????文件???????3692??2014-10-15?11:57??S2316S411H436\doc\db_mysql.sql
?????文件???????3647??2014-10-15?11:57??S2316S411H436\doc\db_oracle.sql
?????文件???????1117??2014-10-12?16:18??S2316S411H436\doc\readme.txt
?????文件?????489984??2014-10-15?14:29??S2316S411H436\doc\項目介紹.doc
?????文件?????445288??2014-09-24?22:49??S2316S411H436\lib\h436\antlr-2.7.7.jar
?????文件?????423876??2014-09-24?22:51??S2316S411H436\lib\h436\c3p0-0.9.2.1.jar
?????文件?????313898??2014-09-24?22:49??S2316S411H436\lib\h436\dom4j-1.6.1.jar
?????文件????1006424??2014-09-24?22:50??S2316S411H436\lib\h436\ehcache-core-2.4.3.jar
?????文件??????40140??2014-09-24?22:51??S2316S411H436\lib\h436\hibernate-c3p0-4.3.6.Final.jar
?????文件??????75324??2014-09-24?22:49??S2316S411H436\lib\h436\hibernate-commons-annotations-4.0.5.Final.jar
?????文件????5254140??2014-09-24?22:49??S2316S411H436\lib\h436\hibernate-core-4.3.6.Final.jar
?????文件?????135516??2014-09-24?22:50??S2316S411H436\lib\h436\hibernate-ehcache-4.3.6.Final.jar
?????文件?????113371??2014-09-24?22:49??S2316S411H436\lib\h436\hibernate-jpa-2.1-api-1.0.0.Final.jar
?????文件??????76551??2014-09-24?22:49??S2316S411H436\lib\h436\jandex-1.1.0.Final.jar
?????文件?????714194??2014-09-24?22:49??S2316S411H436\lib\h436\javassist-3.18.1-GA.jar
?????文件??????57183??2014-09-24?22:49??S2316S411H436\lib\h436\jboss-logging-3.1.3.GA.jar
?????文件??????11558??2014-09-24?22:49??S2316S411H436\lib\h436\jboss-logging-annotations-1.2.0.Beta1.jar
?????文件??????27717??2014-09-24?22:49??S2316S411H436\lib\h436\jboss-transaction-api_1.2_spec-1.0.0.Final.jar
?????文件?????581295??2014-09-24?22:51??S2316S411H436\lib\h436\mchange-commons-java-0.2.3.4.jar
?????文件????????914??2014-10-14?21:51??S2316S411H436\lib\h436\readme.txt
?????文件??????25496??2014-09-24?22:50??S2316S411H436\lib\h436\slf4j-api-1.6.1.jar
............此處省略204個文件信息
評論
共有 條評論