• 大小: 7.39MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-11-02
  • 语言: Java
  • 标签: Java  ssh  在线答疑  

资源简介

基于Java的Struct2、spring2和hibernate的在线答疑系统,使用myeclipse开发,界面功能类似于BBS

资源截图

代码片段和文件信息

package com.anzerong.oa.base;

import java.lang.reflect.ParameterizedType;

import javax.annotation.Resource;

import com.anzerong.oa.domain.User;
import com.anzerong.oa.service.AnswerService;
import com.anzerong.oa.service.CourseService;
import com.anzerong.oa.service.DepartmentService;
import com.anzerong.oa.service.PrivilegeService;
import com.anzerong.oa.service.QuestionService;
import com.anzerong.oa.service.RoleService;
import com.anzerong.oa.service.UserService;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

public abstract class baseAction extends ActionSupport implements ModelDriven {

private static final long serialVersionUID = 1L;

// =============== ModelDriven的支持 ==================

protected T model;

@SuppressWarnings(“unchecked“)
public baseAction() {
try {
// 通过反射获取model的真实类型
ParameterizedType pt = (ParameterizedType) this.getClass().getGenericSuperclass();
Class clazz = (Class) pt.getActualTypeArguments()[0];
// 通过反射创建model的实例
model = clazz.newInstance();
} catch (Exception e) {
throw new RuntimeException(e);
}
}

public T getModel() {
return model;
}

// =============== Service实例的声明 ==================
@Resource
protected RoleService roleService;
@Resource
protected UserService userService;
@Resource
protected DepartmentService departmentService;
@Resource
protected PrivilegeService privilegeService;
@Resource
protected CourseService courseService;
@Resource
protected QuestionService questionService;
@Resource 
protected AnswerService answerService;

/**
 * 获取当前登录的用户
 * 
 * @return
 */
protected User getCurrentUser() {
return (User) ActionContext.getContext().getSession().get(“user“);
}

// ============== 分页用的参数 =============

protected int pageNum = 1; // 当前页
protected int pageSize = 10; // 每页显示多少条记录

public int getPageNum() {
return pageNum;
}

public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}

public int getPageSize() {
return pageSize;
}

public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        945  2014-03-11 10:30  OnlineAnswer\.classpath

     文件        309  2014-04-28 15:03  OnlineAnswer\.mymetadata

     文件       1755  2014-04-11 10:29  OnlineAnswer\.project

     文件        500  2014-03-11 10:24  OnlineAnswer\.settings\.jsdtscope

     文件        364  2014-03-11 10:24  OnlineAnswer\.settings\org.eclipse.jdt.core.prefs

     文件        629  2014-03-11 10:26  OnlineAnswer\.settings\org.eclipse.wst.common.component

     文件        252  2014-03-11 10:24  OnlineAnswer\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2014-03-11 10:24  OnlineAnswer\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2014-03-11 10:24  OnlineAnswer\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       3029  2014-04-13 09:49  OnlineAnswer\configure\applicationContext.xml

     文件       1457  2014-04-19 10:37  OnlineAnswer\configure\hibernate.cfg.xml

     文件        115  2014-04-17 12:23  OnlineAnswer\configure\jdbc.properties

     文件       1583  2014-04-18 13:34  OnlineAnswer\configure\log4j.properties

     文件       4257  2014-04-24 10:42  OnlineAnswer\configure\struts.xml

     文件       2358  2014-04-19 14:26  OnlineAnswer\src\com\anzerong\oa\base\baseAction.java

     文件        938  2014-04-20 15:09  OnlineAnswer\src\com\anzerong\oa\base\DaoSupport.java

     文件       3257  2014-04-20 15:13  OnlineAnswer\src\com\anzerong\oa\base\DaoSupportImpl.java

     文件        176  2014-04-19 10:27  OnlineAnswer\src\com\anzerong\oa\dao\AnswerDao.java

     文件        176  2014-04-18 15:39  OnlineAnswer\src\com\anzerong\oa\dao\CourseDao.java

     文件        187  2014-04-17 13:56  OnlineAnswer\src\com\anzerong\oa\dao\DeparmentDao.java

     文件        315  2014-04-19 10:29  OnlineAnswer\src\com\anzerong\oa\dao\impl\AnswerDaoImpl.java

     文件        315  2014-04-18 15:39  OnlineAnswer\src\com\anzerong\oa\dao\impl\CourseDaoImpl.java

     文件        333  2014-04-17 13:56  OnlineAnswer\src\com\anzerong\oa\dao\impl\DepartmentDaoImpl.java

     文件        330  2014-04-18 09:30  OnlineAnswer\src\com\anzerong\oa\dao\impl\PrivilegeDaoImpl.java

     文件        325  2014-04-19 10:29  OnlineAnswer\src\com\anzerong\oa\dao\impl\QuestionDaoImpl.java

     文件        305  2014-04-17 13:56  OnlineAnswer\src\com\anzerong\oa\dao\impl\RoleDaoImpl.java

     文件        305  2014-04-16 09:16  OnlineAnswer\src\com\anzerong\oa\dao\impl\UserDaoImpl.java

     文件        185  2014-04-18 09:30  OnlineAnswer\src\com\anzerong\oa\dao\PrivilegeDao.java

     文件        182  2014-04-19 10:27  OnlineAnswer\src\com\anzerong\oa\dao\QuestionDao.java

     文件        170  2014-04-17 11:55  OnlineAnswer\src\com\anzerong\oa\dao\RoleDao.java

............此处省略2649个文件信息

评论

共有 条评论