请大家帮忙看看?获取不到值?
这是实现一个按条件查询并将查询结果以列表形式显示到页面的servlet,对数据库查询部分我写在D文件里了?大家帮忙看看为什么取不到查询结果的值呢???帮忙啊???
package com.flight.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import org.apache.commons.beanutils.BeanUtils;
import com.flight.bean.flight;
import com.flight.dao.searchflightDao;
public class searchflightServlet extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response, String String)
throws ServletException, IOException {
doPost(request,response);
}
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String action=request.getParameter("action");
searchflightDao sfdao=new searchflightDao();
if(action.equals("list")){
String start_city = (String) request.getSession().getValue("start_city");
String arrival_city = (String) request.getSession().getValue("arrival_city");
request.setAttribute("faList", sfdao.findById(start_city,arrival_city));//System.out.println(fdao.findAll());
request.getRequestDispatcher("showflight.jsp").forward(request, response);
}
}
public void init() throws ServletException {
// Put your code here
}
}