资源简介
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\st
目录 0 2011-04-18 13:04 17\sl\01\Databa
文件 1048576 2008-11-17 11:32 17\sl\01\Databa
文件 1048576 2008-11-17 11:32 17\sl\01\Databa
文件 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_ti
文件 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个文件信息
相关资源
- 易飞科技算法注册机v5.22.rar
- 机器码工具.zip
- sl-cms.zip
- SpringBoot2.0教程.pdf
- iec61850-7-4{ed2.0}.pdf
- wav_pcm.zip
- zhupenghui1_10466937.zip
- EditPlus3.zip
- OpenCVdemo6by浅墨.rar
- 20170106202228721.zip
- 无线视频传输.zip
- 最优化理论与算法_习题解答.pdf
- gw53kr.pdf
- yunbaozhibosong_9884748.zip
- optisystem7.0破解包.rar
- v.tar.gz
- Multisim11.0加破解及汉化补丁.rar
- 组态王6.52破解.rar
- 项目经理面试指南(上下册).rar
- NetBot_Attackervip6.0完美中文破解版2010
- dicomviewer.rar
- 《我和LabVIEW》程序2010.04.02.1.7z
- CCProxy8中文注册版.rar
- xds100_drivers.zip
- 最优化理论与算法习题解答.pdf
- 信号与系统郑君里+答案(1).rar
- QJC自动点名器(随机点名软件)V1.1
- 爱宝淘宝会员吸纳打标软件v3.3绿色版
- CHM2PDF(CHM转PDF格式转换器)V3.0破解版
- 软件项目投标书模板.rar
评论
共有 条评论