81,091
社区成员
发帖
与我相关
我的任务
分享
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String path = "/index.jsp";
List<Books> all = null;
try{
all = DaoFactory.getIBookDaoInstance().findAll(" ");
}catch(Exception e){
e.printStackTrace();
}finally{
}
System.out.println("dd");
request.setAttribute("books", all);
request.getRequestDispatcher("/index.jsp").forward(request, response);
System.out.println("dd");
}
request.getRequestDispatcher("/index.jsp").forward(request, response);
服务器端调整,地址栏不会变的。 String sql = "select * from Books where bno like ? or bname like ? or bkind like ?";
this.pstmt = this.conn.prepareStatement(sql);
pstmt.setString(1,"%"+keyWord+"%");
pstmt.setString(2,"%"+keyWord+"%");
pstmt.setString(3,"%"+keyWord+"%");
这句话出了问题,上面是改正后的,因为查询语句没有查到的原因