• 大小: 5.65MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-22
  • 语言: Java
  • 标签: javaWeb  

资源简介

javaWeb投票管理系统源码

资源截图

代码片段和文件信息

package com.sanqing.action;

import java.util.UUID;

import com.opensymphony.xwork2.ActionSupport;
import com.sanqing.bean.Vote;
import com.sanqing.bean.VoteOption;
import com.sanqing.dao.VoteDAO;
import com.sanqing.dao.VoteOptionDAO;
import com.sanqing.daoFactory.VoteDAOFactory;
import com.sanqing.daoFactory.VoteOptionDAOFactory;

public class AddVoteAction extends ActionSupport {
private int channel; // 封装channel参数
private String voteName; // 封装voteName参数
private String[] voteOption;// 封装voteOption参数

public int getChannel() {
return channel;
}

public void setChannel(int channel) {
this.channel = channel;
}

public String getVoteName() {
return voteName;
}

public void setVoteName(String voteName) {
this.voteName = voteName;
}

public String[] getVoteOption() {
return voteOption;
}

public void setVoteOption(String[] voteOption) {
this.voteOption = voteOption;
}

public String execute() throws Exception {
VoteDAO voteDAO = VoteDAOFactory.getVoteDAOInstance();//获得VoteDAO实例
VoteOptionDAO voteOptionDAO = 
VoteOptionDAOFactory.getVoteOptionDAOInstance();//获得voteOption实例
//首先保存投票,然后再保存投票选项
Vote vote = new Vote();
vote.setChannelID(channel);
vote.setVoteName(voteName);
voteDAO.addVote(vote);
//查询投票ID
int voteID = voteDAO.findVoteByName(voteName).getVoteID();
//保存投票选项
for(String voteOptionName : voteOption) {
VoteOption vp = new VoteOption();
vp.setVoteID(voteID);
vp.setVoteOptionName(voteOptionName);
voteOptionDAO.addVoteOption(vp);
}
return this.SUCCESS;
}

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-02-04 11:38  JavaPrj_2\
     文件        1092  2010-01-27 15:25  JavaPrj_2\.classpath
     目录           0  2014-05-19 14:53  JavaPrj_2\.myeclipse\
     文件         300  2010-01-27 15:25  JavaPrj_2\.mymetadata
     文件        1227  2009-08-28 10:18  JavaPrj_2\.project
     目录           0  2014-05-19 14:52  JavaPrj_2\src\
     目录           0  2014-05-19 14:52  JavaPrj_2\src\com\
     目录           0  2014-05-19 14:52  JavaPrj_2\src\com\sanqing\
     目录           0  2014-05-19 14:52  JavaPrj_2\src\com\sanqing\action\
     文件        1662  2009-08-28 14:12  JavaPrj_2\src\com\sanqing\action\AddVoteAction.java
     文件        1043  2009-08-30 09:25  JavaPrj_2\src\com\sanqing\action\DeleteVoteAction.java
     文件        2311  2009-08-30 15:40  JavaPrj_2\src\com\sanqing\action\DoVoteAction.java
     文件        1707  2009-08-29 10:33  JavaPrj_2\src\com\sanqing\action\ShowVoteAction.java
     文件        2041  2009-08-30 15:12  JavaPrj_2\src\com\sanqing\action\ShowVoteByChannelAction.java
     文件        1819  2009-08-30 15:16  JavaPrj_2\src\com\sanqing\action\VoteResultAction.java
     目录           0  2014-05-19 14:52  JavaPrj_2\src\com\sanqing\bean\
     文件         453  2009-08-28 11:18  JavaPrj_2\src\com\sanqing\bean\Channel.java
     文件         569  2009-08-28 11:30  JavaPrj_2\src\com\sanqing\bean\Vote.java
     文件         809  2009-08-30 10:45  JavaPrj_2\src\com\sanqing\bean\VoteOption.java
     文件         424  2009-08-29 09:55  JavaPrj_2\src\com\sanqing\bean\VoteResult.java
     目录           0  2014-05-19 14:52  JavaPrj_2\src\com\sanqing\dao\
     目录           0  2014-05-19 14:52  JavaPrj_2\src\com\sanqing\daoFactory\
     文件         283  2009-08-28 11:35  JavaPrj_2\src\com\sanqing\daoFactory\VoteDAOFactory.java
     文件         319  2009-08-28 11:36  JavaPrj_2\src\com\sanqing\daoFactory\VoteOptionDAOFactory.java
     目录           0  2014-05-19 14:52  JavaPrj_2\src\com\sanqing\daoImpl\
     文件        6796  2009-08-30 09:40  JavaPrj_2\src\com\sanqing\daoImpl\VoteDAOImpl.java
     文件        4560  2009-08-30 14:08  JavaPrj_2\src\com\sanqing\daoImpl\VoteOptionDAOImpl.java
     文件         687  2009-08-30 09:39  JavaPrj_2\src\com\sanqing\dao\VoteDAO.java
     文件         497  2009-08-29 09:40  JavaPrj_2\src\com\sanqing\dao\VoteOptionDAO.java
     目录           0  2014-05-19 14:52  JavaPrj_2\src\com\sanqing\util\
     文件        1714  2009-08-28 11:28  JavaPrj_2\src\com\sanqing\util\DBConnection.java
............此处省略137个文件信息

评论

共有 条评论