大家好,我是考100分的小小码 ,祝大家学习进步,加薪顺利呀。今天说一说使用Javaweb实现在线调查问卷系统[亲测有效],希望您对编程的造诣更进一步.
项目编号:BS-PT-014
开发技术: jsp/servlet 前端技术:jquery+layui
开发工具:IDEA/Eclipse
数据库:MYSQL5
功能介绍:
在线调查问卷系统:实现了调查问卷管理,调查项管理,问卷审核管理,问卷统计管理,用户管理,友情链接管理等功能。问卷支持单选,多选,问答多种调查题型。支持公开问卷和私有问卷等类型。功能完整,运行无误。
部分功能截图:
首页:
调查问卷填写:
问卷列表展示:
后台管理界面:
网站系统配置:
问卷管理:
友情连接管理:
问卷添加:
问卷审核:问卷添加后,审核通过才能使用
问卷统计:统计每个调查问卷的情况
用户管理:
友情连接管理:
以上就是网络在线调查问卷系统的基本功能,可以根据需求进行调整。基于JSP实现的在线调查问卷系统。
package com.ec.survey.ctrl;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.URLEncoder;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ec.survey.dao.AdminDAO;
import com.ec.survey.dao.DAOFactory;
import com.ec.survey.dao.QuestionDAO;
import com.ec.survey.dao.SurveyDAO;
import com.ec.survey.dto.Admin;
public class AdminManage extends HttpServlet {
/** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doPost(request, response);
}
/** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String mutex1="";
//String mutex2="";
String op=request.getParameter("op");
if("AddAdmin".equals(op)){
String username=request.getParameter("username");
String pwd=request.getParameter("pwd");
AdminDAO dao=DAOFactory.getAdminDAO();
Admin admin=new Admin();
admin.setA_user(username);
admin.setA_pass(pwd);
boolean ret1=dao.addAdmin(admin);
if(ret1)
response.sendRedirect("../admin/AdminList.jsp");
else
response.sendRedirect("../admin/OpResult.jsp?op=default&ret=false&words="+URLEncoder.encode("增加管理员出错!请联系管理员", "UTF-8") );
}
else if("DelAdmin".equals(op)){
Long aid=Long.valueOf(request.getParameter("aid"));
AdminDAO dao=DAOFactory.getAdminDAO();
boolean ret1=dao.delAdmin(aid);
if(ret1)
response.sendRedirect("../admin/AdminList.jsp");
else
response.sendRedirect("../admin/OpResult.jsp?op=default&ret=false&words="+URLEncoder.encode("删除管理员出错!请联系管理员", "UTF-8"));
}else if("EditAdmin".equals(op)){
Long aid=Long.valueOf(request.getParameter("aid"));
String oldpwd=request.getParameter("oldpwd");
String pwd=request.getParameter("pwd");
String username=request.getParameter("username");
AdminDAO dao=DAOFactory.getAdminDAO();
if(dao.checkPwd(username, oldpwd)!=true){
response.sendRedirect("../admin/OpResult.jsp?op=default&ret=false&words="+URLEncoder.encode("旧密码错误", "UTF-8"));
return;
}
synchronized(mutex1){
Admin admin=dao.findAdmin(aid);
admin.setA_user(username);
admin.setA_pass(pwd);
boolean ret1=dao.updateAdmin(admin);
if(ret1)
response.sendRedirect("../admin/AdminList.jsp");
else
response.sendRedirect("../admin/OpResult.jsp?op=default&ret=false&words="+URLEncoder.encode("编辑管理员出错!请联系管理员", "UTF-8"));
}
}
}
}
\
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
转载请注明出处: https://daima100.com/13780.html