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

资源简介

本人的呕心沥血之作!

资源截图

代码片段和文件信息

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. 

 *
 * 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. 

 *
 * 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“));
retur

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

     文件       1538  2016-04-12 16:10  survey\survey\.classpath

     文件        291  2016-04-11 16:41  survey\survey\.mymetadata

     文件       1749  2016-04-11 16:35  survey\survey\.project

     文件        580  2016-04-11 16:35  survey\survey\.settings\.jsdtscope

     文件        105  2016-04-11 16:38  survey\survey\.settings\com.genuitec.eclipse.core.prefs

     文件       1040  2016-04-11 16:41  survey\survey\.settings\com.genuitec.eclipse.j2eedt.core.prefs

     文件        247  2016-04-11 18:18  survey\survey\.settings\com.genuitec.eclipse.migration.prefs

     文件        111  2016-04-11 21:29  survey\survey\.settings\org.eclipse.core.resources.prefs

     文件        598  2016-04-12 16:06  survey\survey\.settings\org.eclipse.jdt.core.prefs

     文件        544  2016-04-11 18:18  survey\survey\.settings\org.eclipse.wst.common.component

     文件        343  2016-04-11 18:18  survey\survey\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2016-04-11 16:35  survey\survey\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2016-04-11 16:35  survey\survey\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件      11081  2009-04-14 23:07  survey\survey\dbo.mer

     文件       3497  2009-04-10 22:57  survey\survey\src\com\ec\survey\ctrl\AdminManage.java

     文件       2550  2009-01-17 00:29  survey\survey\src\com\ec\survey\ctrl\ConfigManage.java

     文件       3931  2009-04-09 13:42  survey\survey\src\com\ec\survey\ctrl\linkManage.java

     文件       6735  2009-04-09 23:52  survey\survey\src\com\ec\survey\ctrl\QuestionManage.java

     文件       7037  2009-04-09 13:44  survey\survey\src\com\ec\survey\ctrl\ShowSurvey.java

     文件       3422  2009-04-09 13:36  survey\survey\src\com\ec\survey\ctrl\StatisManage.java

     文件       7334  2009-04-13 09:46  survey\survey\src\com\ec\survey\ctrl\SurveyManage.java

     文件        411  2009-03-09 23:16  survey\survey\src\com\ec\survey\dao\AdminDAO.java

     文件        535  2009-03-22 21:48  survey\survey\src\com\ec\survey\dao\AnswersheetDAO.java

     文件        163  2008-11-28 23:42  survey\survey\src\com\ec\survey\dao\ConfigDAO.java

     文件        763  2009-03-13 21:33  survey\survey\src\com\ec\survey\dao\DAOFactory.java

     文件        408  2008-11-14 11:31  survey\survey\src\com\ec\survey\dao\GusetbookDAO.java

     文件        332  2008-11-14 16:34  survey\survey\src\com\ec\survey\dao\linkDAO.java

     文件       3591  2009-03-10 22:41  survey\survey\src\com\ec\survey\dao\mssqlimpl\AdminDAOimpl.java

     文件       4382  2009-03-22 22:54  survey\survey\src\com\ec\survey\dao\mssqlimpl\AnswersheetDAOimpl.java

     文件       1741  2009-02-28 16:53  survey\survey\src\com\ec\survey\dao\mssqlimpl\ConfigDAOimpl.java

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

评论

共有 条评论

相关资源