如何将查询出的结果作为参数(动态)传递到下一个页面中啊。
比如在1.jsp中查询
String sql="select * from book where name like ‘%"+keyword+"%';
//keyword为输入的关键字
.
.
.
out.print(<a href="2.jsp">+rs.getString("author")+</a>)我在2.jsp想利用1.jsp中查询的来的author再次进行查询, 这样如何写才能让1.jsp中的那个超链接把查询到的动态参数传到2.jsp中啊!
比如在1.jsp中查询
String sql="select * from book where name like ‘%"+keyword+"%';
//keyword为输入的关键字
.
.
.
out.print(<a href="2.jsp">+rs.getString("author")+</a>)我在2.jsp想利用1.jsp中查询的来的author再次进行查询, 这样如何写才能让1.jsp中的那个超链接把查询到的动态参数传到2.jsp中啊!
在2.jsp里String author = request.getParameter("author");//取得在1.jsp中查询到的结果
另外为什么 <a href=....</a>
不是<a href=...></a>这样?
out.print(" <a href=\"2.jsp?author="+rs.getString("author")+ "\">2 </a>");