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

资源简介

myeclipse项目

资源截图

代码片段和文件信息

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

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2009-04-16 19:37  survey\
     文件         740  2009-04-10 19:41  survey\.classpath
     文件         292  2009-02-28 13:13  survey\.mymetadata
     文件        1412  2008-11-22 16:08  survey\.project
     目录           0  2009-02-28 16:31  survey\.settings\
     文件         406  2008-11-22 16:08  survey\.settings\.jsdtscope
     文件        1040  2008-11-06 20:36  survey\.settings\com.genuitec.eclipse.j2eedt.core.prefs
     文件         116  2009-04-08 22:48  survey\.settings\org.eclipse.core.resources.prefs
     文件          49  2008-11-22 16:08  survey\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2008-11-22 16:08  survey\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件       11081  2009-04-14 23:07  survey\dbo.mer
     目录           0  2009-03-28 11:20  survey\src\
     目录           0  2008-11-13 10:53  survey\src\com\
     目录           0  2008-11-13 10:53  survey\src\com\ec\
     目录           0  2008-11-28 16:35  survey\src\com\ec\survey\
     目录           0  2009-03-15 12:46  survey\src\com\ec\survey\ctrl\
     文件        3497  2009-04-10 22:57  survey\src\com\ec\survey\ctrl\AdminManage.java
     文件        2550  2009-01-17 00:29  survey\src\com\ec\survey\ctrl\ConfigManage.java
     文件        3931  2009-04-09 13:42  survey\src\com\ec\survey\ctrl\linkManage.java
     文件        6735  2009-04-09 23:52  survey\src\com\ec\survey\ctrl\QuestionManage.java
     文件        7037  2009-04-09 13:44  survey\src\com\ec\survey\ctrl\ShowSurvey.java
     文件        3422  2009-04-09 13:36  survey\src\com\ec\survey\ctrl\StatisManage.java
     文件        7334  2009-04-13 09:46  survey\src\com\ec\survey\ctrl\SurveyManage.java
     目录           0  2009-02-07 17:50  survey\src\com\ec\survey\dao\
     文件         411  2009-03-09 23:16  survey\src\com\ec\survey\dao\AdminDAO.java
     文件         535  2009-03-22 21:48  survey\src\com\ec\survey\dao\AnswersheetDAO.java
     文件         163  2008-11-28 23:42  survey\src\com\ec\survey\dao\ConfigDAO.java
     文件         763  2009-03-13 21:33  survey\src\com\ec\survey\dao\DAOFactory.java
     文件         408  2008-11-14 11:31  survey\src\com\ec\survey\dao\GusetbookDAO.java
     文件         332  2008-11-14 16:34  survey\src\com\ec\survey\dao\linkDAO.java
     目录           0  2009-03-11 08:42  survey\src\com\ec\survey\dao\mssqlimpl\
............此处省略255个文件信息

评论

共有 条评论