请大家帮忙看看?获取不到值?

tearsmo57 2010-10-26 07:04:39

这是实现一个按条件查询并将查询结果以列表形式显示到页面的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
}

}
...全文
48 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Rangers_Sword 2010-10-29
  • 打赏
  • 举报
回复
...
shadow55 2010-10-26
  • 打赏
  • 举报
回复
就贴那么点信息,神仙都不知道,先看一下
sfdao.findById(start_city,arrival_city)
这个查询出数据没吧,自己一步步的debug

23,407

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧