资源简介
全部代码,和数据sql,已经调试成功,导入修改数据库即可使用
代码片段和文件信息
package com.action;
import java.lang.reflect.ParameterizedType;
import java.util.Map;
import org.apache.struts2.interceptor.ApplicationAware;
import org.apache.struts2.interceptor.RequestAware;
import org.apache.struts2.interceptor.SessionAware;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.dao.TAdminDAO;
import com.dao.TCatelogDAO;
import com.dao.TGonggaoDAO;
import com.dao.TLiuyanDAO;
import com.dao.TRenDAO;
import com.dao.TUserDAO;
/*
* 基于action类的
*/
public class baseAction extends ActionSupport implements RequestAware
SessionAware ApplicationAwareModelDriven{
private static final long serialVersionUID = 1L;//版本号
protected T model;//对应不同实体类
protected Mapject> application;
protected Mapject> session;
protected Mapject> request;
protected String message;
protected String path;
protected TAdminDAO adminDAO;//管理员dao层
protected TCatelogDAO catelogDAO;//日志
protected TGonggaoDAO gonggaoDAO;//公告
protected TLiuyanDAO liuyanDAO;//留言
protected TRenDAO renDAO;//人员
protected TUserDAO userDAO;//用户
//通过反射创建对象
@SuppressWarnings(“unchecked“)
public baseAction(){
ParameterizedType type =
(ParameterizedType) this.getClass().getGenericSuperclass();
Class clazz = (Class) type.getActualTypeArguments()[0];
try {
model = (T) clazz.newInstance();//创建对象
} catch (Exception e) {
throw new RuntimeException(e);
}
}
@Override
public T getModel() {
return model;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
public TAdminDAO getAdminDAO() {
return adminDAO;
}
public void setAdminDAO(TAdminDAO adminDAO) {
this.adminDAO = adminDAO;
}
public TCatelogDAO getCatelogDAO() {
return catelogDAO;
}
public void setCatelogDAO(TCatelogDAO catelogDAO) {
this.catelogDAO = catelogDAO;
}
public TGonggaoDAO getGonggaoDAO() {
return gonggaoDAO;
}
public void setGonggaoDAO(TGonggaoDAO gonggaoDAO) {
this.gonggaoDAO = gonggaoDAO;
}
public TLiuyanDAO getLiuyanDAO() {
return liuyanDAO;
}
public void setLiuyanDAO(TLiuyanDAO liuyanDAO) {
this.liuyanDAO = liuyanDAO;
}
public TRenDAO getRenDAO() {
return renDAO;
}
public void setRenDAO(TRenDAO renDAO) {
this.renDAO = renDAO;
}
public TUserDAO getUserDAO() {
return userDAO;
}
public void setUserDAO(TUserDAO userDAO) {
this.userDAO = userDAO;
}
@Override
public void setApplication(Map application) {
this.application = application;
}
@Override
public void setSession(Map session) {
this.session = session;
}
@Override
public void setRequest(Map request) {
this.request = request;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1093 2017-04-21 16:23 addressbook\.classpath
文件 1336 2017-04-21 16:23 addressbook\.project
文件 522 2017-04-21 16:23 addressbook\.settings\.jsdtscope
文件 69 2017-04-21 16:23 addressbook\.settings\org.eclipse.core.resources.prefs
文件 364 2017-04-21 16:23 addressbook\.settings\org.eclipse.jdt.core.prefs
文件 492 2017-04-21 16:23 addressbook\.settings\org.eclipse.wst.common.component
文件 414 2017-04-21 16:23 addressbook\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-04-21 16:23 addressbook\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-04-21 16:23 addressbook\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 1323 2017-04-21 16:23 addressbook\.settings\org.eclipse.wst.validation.prefs
文件 2992 2017-04-21 16:23 addressbook\src\com\action\ba
文件 1018 2017-04-21 16:23 addressbook\src\com\action\CatelogAction.java
文件 1266 2017-04-21 16:23 addressbook\src\com\action\GonggaoAction.java
文件 1078 2017-04-21 16:23 addressbook\src\com\action\LiuyanAction.java
文件 1518 2017-04-21 16:23 addressbook\src\com\action\RenAction.java
文件 1346 2017-04-21 16:23 addressbook\src\com\action\UserAction.java
文件 2018 2017-04-21 16:23 addressbook\src\com\dao\TAdminDAO.java
文件 2250 2017-04-21 16:23 addressbook\src\com\dao\TCatelogDAO.java
文件 2635 2017-04-21 16:23 addressbook\src\com\dao\TGonggaoDAO.java
文件 1757 2017-04-21 16:23 addressbook\src\com\dao\TLiuyanDAO.java
文件 1749 2017-04-21 16:23 addressbook\src\com\dao\TRenDAO.java
文件 2502 2017-04-21 16:23 addressbook\src\com\dao\TUserDAO.java
文件 646 2017-04-21 16:23 addressbook\src\com\model\TAdmin.hbm.xm
文件 845 2017-04-21 16:23 addressbook\src\com\model\TAdmin.java
文件 673 2017-04-21 16:23 addressbook\src\com\model\TCatelog.hbm.xm
文件 839 2017-04-21 16:23 addressbook\src\com\model\TCatelog.java
文件 782 2017-04-21 16:23 addressbook\src\com\model\TGonggao.hbm.xm
文件 710 2017-04-21 16:23 addressbook\src\com\model\TGonggao.java
文件 873 2017-04-21 16:23 addressbook\src\com\model\TLiuyan.hbm.xm
文件 1237 2017-04-21 16:23 addressbook\src\com\model\TLiuyan.java
............此处省略246个文件信息
评论
共有 条评论