急!!java往jsp中传值问题?
答案:2 悬赏:10 手机版
解决时间 2021-02-27 23:00
- 提问者网友:謫仙
- 2021-02-27 10:17
急!!java往jsp中传值问题?
最佳答案
- 五星知识达人网友:woshuo
- 2021-02-27 10:47
String SQL = "SELECt * from note";
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
List mylist = new ArrayList();
while(rs.next()){
Book book = new Book();
book.setName(rs.getString(1));
book.setPasw(rs.getString(2));
mylist.add(book);
}
你要把mylist放在request里面
加上一句 request.setAttribut("mylist",mylist);
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
List
while(rs.next()){
Book book = new Book();
book.setName(rs.getString(1));
book.setPasw(rs.getString(2));
mylist.add(book);
}
你要把mylist放在request里面
加上一句 request.setAttribut("mylist",mylist);
全部回答
- 1楼网友:愁杀梦里人
- 2021-02-27 11:46
String SQL = "SELECt * from note";
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
List mylist = new ArrayList();
while(rs.next()){
Book book = new Book();
book.setName(rs.getString(1));
book.setPasw(rs.getString(2));
mylist.add(book);
}
后面掉了return mylist;
stmt = con.createStatement();
rs = stmt.executeQuery(SQL);
List
while(rs.next()){
Book book = new Book();
book.setName(rs.getString(1));
book.setPasw(rs.getString(2));
mylist.add(book);
}
后面掉了return mylist;
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯