简体   繁体   中英

Error in passing values from a jsp page to another

I am a beginner.In my project I am using JSP and Mysql Workbench. I got an error in passing one value from a jsp page to another the code that I used was

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

The error showing is ) Expected But I cant identify where is the error please somebody help me.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM