📄 selectfollowservlet.java
字号:
package com.accp.oa.control.servlet.client;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.accp.oa.dao.imple.CallDAO;
import com.accp.oa.dao.imple.FollwDAO;
import com.accp.oa.dao.imple.commonDAO;
/**
* 查询出跟进信息
* @author Administrator
*
*/
public class SelectFollowServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public SelectFollowServlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
*在doGet方法中进行了处理
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
//获得采购项目
String items = request.getParameter("item");
//获得talname的值
String tablename = request.getParameter("talname");
HttpSession session = request.getSession(true);
//把StockItemes存入session中保存
session.setAttribute("StockItmes", items);
//如果是follow就进行处理
if(tablename == "follow" ||tablename.equals("follow")){
commonDAO common = commonDAO.GetcomonDAO();
FollwDAO followdao = FollwDAO.getFollwDAO();
int totalpage = common.gettatolpage();
String nums = request.getParameter("topage");
//如果nums为空就进行初始化
if (nums == null || nums == "")
nums = "1";
//查询出的信息存入Arraylist对象中
ArrayList list = followdao.search(nums, "tb_Follw", items);
int num = common.getpagenumber();
if (num < 1 || num > totalpage)
num = 1;
//把ArrayLIst对象存入session中进行了保存
session.setAttribute("Follwlist", list);
session.setAttribute("followrows", String.valueOf(common.gettatolrows()));
session.setAttribute("Follwnum", String.valueOf(num));
session.setAttribute("followtotalpage", String.valueOf(common.gettatolpage()));
//进行转发处理
request.getRequestDispatcher("/customermanage/Follow_Index.jsp")
.forward(request, response);
}else{//不是跨进
commonDAO common = commonDAO.GetcomonDAO();
CallDAO calldao = CallDAO.getCallDAO();
int totalpage = common.gettatolpage();
String nums = request.getParameter("topage");
if (nums == null || nums == "")
nums = "1";
// 查询出的信息存入Arraylist对象中
ArrayList list = calldao.search(nums, "tb_Call", items);
int num = common.getpagenumber();
if (num < 1 || num > totalpage)
num = 1;
// 把ArrayLIst对象存入session中进行了保存
session.setAttribute("callrows", String.valueOf(common.gettatolrows()));
session.setAttribute("Calllist", list);
session.setAttribute("Callnum", String.valueOf(num));
session.setAttribute("calltotalpage", String.valueOf(common.gettatolpage()));
// 进行转发处理
request.getRequestDispatcher("/customermanage/Call_Index.jsp")
.forward(request, response);
}
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
doGet(request, response);
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException
* if an error occure
*/
public void init() throws ServletException {
// Put your code here
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -