Salini L
Salini L

Reputation: 879

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.

Upvotes: 0

Views: 206

Answers (1)

sanbhat
sanbhat

Reputation: 17622

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

Upvotes: 2

Related Questions