• 大小: 21.53M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-01-19
  • 语言: Java
  • 标签: java  投票系统  

资源简介


采用spring struts2框架搭建

-----------------------------------------------------------------------------------

后台管理
现阶段只有一个功能,即新投票发起功能(addvote.jsp);

-----------------------------------------------------------------------------------

前台管理

(1)参与投票用户登录页面(index.jsp);
(2)用户投票页面(welcome.jsp);

(3)投票结果显示页面(result.jsp);


其他说明
(1)在“jdbc.properties”文件中配置Mysql数据库相关参数,主要是连接url,username,password;
(2)新发起的投票主题,需要手动在数据库中将其status改为"Open",用户才能对该主题进行投票;
(3)暂时一次只能进行一个主题的投票,已经完成投票操作的主题,需要手动将其status改为"Closed";






资源截图

代码片段和文件信息

package cn.vote.action;

import javax.annotation.Resource;

import cn.vote.service.VoteService;
import cn.vote.table.Votetheme;
import cn.vote.timer.Timer;
import cn.vote.util.StatusConst;

import com.opensymphony.xwork2.ActionSupport;

import freemarker.log.Logger;

public class AddVoteAction extends ActionSupport {

/**
 * 
 */
private static final long serialVersionUID = 1L;
Logger logger = Logger.getLogger(this.getClass().getName());
private Votetheme vote;
@Resource
private VoteService voteService;

public String addVote(){
vote.setCreatetime(Timer.getCurrentTime());
vote.setStatus(StatusConst.NEW);
if(vote.getVotemin()==null){
vote.setVotemax(1);
vote.setVotemin(1);
}
Votetheme newVote = voteService.addVote(vote);
if(newVote != null && newVote.getId() != 

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

     文件       4517  2014-07-19 11:03  voteSystem-master\database\vote.sql

     文件       2907  2014-07-19 11:03  voteSystem-master\database\数据库表.txt

     文件        666  2014-07-19 11:03  voteSystem-master\database\说明文件.txt

     文件         36  2014-07-19 11:03  voteSystem-master\README.md

     文件        623  2014-07-19 11:03  voteSystem-master\VoteSystem\.classpath

     文件       1007  2014-07-19 11:03  voteSystem-master\VoteSystem\.project

     文件        491  2014-07-19 11:03  voteSystem-master\VoteSystem\.settings\.jsdtscope

     文件        186  2014-07-19 11:03  voteSystem-master\VoteSystem\.settings\org.eclipse.core.resources.prefs

     文件         50  2014-07-19 11:03  voteSystem-master\VoteSystem\.settings\org.eclipse.core.runtime.prefs

     文件        357  2014-07-19 11:03  voteSystem-master\VoteSystem\.settings\org.eclipse.jdt.core.prefs

     文件        554  2014-07-19 11:03  voteSystem-master\VoteSystem\.settings\org.eclipse.wst.common.component

     文件        296  2014-07-19 11:03  voteSystem-master\VoteSystem\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2014-07-19 11:03  voteSystem-master\VoteSystem\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2014-07-19 11:03  voteSystem-master\VoteSystem\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       2057  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\action\AddVoteAction.class

     文件       1896  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\action\LoginAction.class

     文件       5249  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\action\VoteAction.class

     文件        963  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\dao\GenericDAO.class

     文件       3484  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\dao\GenericDaoHibernate.class

     文件       3731  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\impl\LoginServiceImpl.class

     文件        800  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\impl\UserServiceImpl.class

     文件       6210  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\impl\VoteServiceImpl.class

     文件        185  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\inter\UserServiceInter.class

     文件       2789  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\model\Users.class

     文件       2895  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\model\Voteinfo.class

     文件       2756  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\model\Voteitem.class

     文件       4210  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\model\Votetheme.class

     文件        259  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\service\LoginService.class

     文件        634  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\service\VoteService.class

     文件       1085  2014-07-19 11:03  voteSystem-master\VoteSystem\build\classes\cn\vote\table\Users.class

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

评论

共有 条评论