0

我是初学者。在我的项目中,我使用的是 JSP 和 Mysql Workbench。我在将一个值从 jsp 页面传递到另一个页面时出错,我使用的代码是

response.sendRedirect("setter.jsp?userid=<%=(rs.getInt("user_id"))%>");

显示的错误是)预期的,但我无法确定错误在哪里,请有人帮助我。

4

1 回答 1

2

Not sure why you need scriptlet tag, when you are already inside scriptlet. Shouldn't it be

response.sendRedirect("setter.jsp?userid="+rs.getInt("user_id"));

PS:

  • As quoted in the comments, I am not sure if redirection can be done from JSP. I concentrated on the syntax.
  • Use JSTL instead of scriptlets
于 2013-08-27T14:32:21.453 回答