• 大小: 1.56M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-31
  • 语言: 其他
  • 标签: 其他  

资源简介

17.zip

资源截图

代码片段和文件信息

package com.wgh.action;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.wgh.dao.AddressListDAO;
import com.wgh.model.AddressListForm;
import com.wgh.tools.StringUtils;

public class AddressListServlet extends HttpServlet {
AddressListDAO addressListDAO=new AddressListDAO();
public void destroy() {
super.destroy(); 
}

public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
doPost(requestresponse);
}

public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {

String action = request.getParameter(“action“);
if (“add“.equals(action)) {
this.add(request response);
}if(“query“.equals(action)){
this.query(request response);
}if(“del“.equals(action)){
this.del(request response);
}
}
//添加联系人
public void add(HttpServletRequest requestHttpServletResponse response) throws IOException{
response.setContentType(“text/html;charset=GBK“);
StringUtils su=new StringUtils();
AddressListForm f=new AddressListForm();
f.setName(su.toGBK(request.getParameter(“name“)));
f.setEmail(request.getParameter(“email“));
f.setBirthday(request.getParameter(“birthday“));
f.setGroupId(Integer.parseInt(request.getParameter(“groupId“)));
f.setTel(request.getParameter(“tel“));
f.setUserEmail(request.getParameter(“userEmail“));
int rtn=addressListDAO.insert(f);
if(rtn==2){
request.setAttribute(“error“ “该联系人已经添加!“);
    try {
request.getRequestDispatcher(“error.jsp“).forward(request
response);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else if(rtn==0){
request.setAttribute(“error“ “添加联系人失败“);
    try {
request.getRequestDispatcher(“error.jsp“).forward(request
response);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else{
PrintWriter out;
out = response.getWriter();
out.print(“ript language=javascript>alert(‘添加联系人成功!‘);window.location.href=‘AddressList?action=query‘;ript>“);
}
}
//查询全部联系人
public void query(HttpServletRequest requestHttpServletResponse response) throws IOException{
 request.setAttribute(“typeList“addressListDAO.queryType());
 //将页面重定向到显示联系人列表页面
 RequestDispatcher requestDispatcher = request
.getRequestDispatcher(“addressList_list.jsp“);
 try {
requestDispatcher.forward(request response);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();

}
//删除联系人
public void del(HttpServletRequest requestHttpServletResponse response) throws IOException{
respon

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2011-04-18 13:04  17\
     目录           0  2011-04-18 13:04  17\sl\
     目录           0  2011-04-18 15:58  17\sl\01\
     文件        4048  2008-11-13 23:31  17\sl\01\addressList_list.jsp
     文件         438  2008-08-21 13:34  17\sl\01\blank.htm
     文件        1578  2006-09-13 16:00  17\sl\01\color.jsp
     文件        1035  2008-08-20 09:08  17\sl\01\copyright.jsp
     目录           0  2011-04-18 13:04  17\sl\01\Css\
     文件        2191  2008-09-20 14:22  17\sl\01\Css\style.css
     目录           0  2011-04-18 13:04  17\sl\01\Database\
     文件     1048576  2008-11-17 11:32  17\sl\01\Database\db_email_Data.MDF
     文件     1048576  2008-11-17 11:32  17\sl\01\Database\db_email_Log.LDF
     文件         159  2008-08-20 09:08  17\sl\01\deal.jsp
     文件        4826  2008-09-23 18:28  17\sl\01\emailList.jsp
     文件        1112  2008-08-20 09:09  17\sl\01\error.jsp
     目录           0  2011-04-18 23:47  17\sl\01\images\
     文件        3984  2008-09-23 18:44  17\sl\01\images\addressList_title.gif
     文件         154  2008-08-22 14:42  17\sl\01\images\adjunct.gif
     文件      102852  2007-09-27 18:01  17\sl\01\images\bottom.JPG
     文件         829  2008-09-17 13:21  17\sl\01\images\bottom_bg.jpg
     文件       17483  2008-08-19 09:34  17\sl\01\images\bottom_line.jpg
     文件       14807  2007-09-27 18:41  17\sl\01\images\btn_bg.jpg
     文件       74091  2008-10-29 10:44  17\sl\01\images\b_top3.gif
     文件       10196  2008-09-17 13:23  17\sl\01\images\center_b.gif
     文件       27597  2007-12-10 23:16  17\sl\01\images\error.jpg
     文件        1682  2007-11-06 13:01  17\sl\01\images\error_b.gif
     文件         533  2008-04-21 11:48  17\sl\01\images\folder.gif
     文件        1202  2008-04-19 14:00  17\sl\01\images\jia.gif
     文件         746  2008-04-19 14:00  17\sl\01\images\jian.gif
     文件        1194  2008-04-19 14:01  17\sl\01\images\jian_null.gif
     文件         354  2008-09-17 13:23  17\sl\01\images\left_bg.GIF
............此处省略87个文件信息

评论

共有 条评论