Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

response.sendRedirect()  RSS feed

 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers..
I'm doing JSP and oracle

in a new user registration form..
when the user registers a login name and password.. and submit..
the page will validate the username is already exists or not and
if it is exist it will redirect to the same page with a message
"The user already exist" and the fields for First name, Last name etc etc will be the same..

in the verification part..
i'm doing like this

String query = "Select username from system.erp_main where username='username' ";
ResultSet rs = stmt.executeQuery(query);
out.println("executed");
int i=0;
while(rs.next())
{String unameser = rs.getString(1);
i++;
}
if(i==0)
{response.sendRedirect("validate_new_user.jsp?<%=fname=fname"%> ;

}
else
out.println("User validate successful!!");



so in the response.sendRedirect i want to put the parameters and then only i can display it in the text box of next page..

please help me ranchers.
is it possible to send the parameters with the command respons.sendRedirect
if so.. please help me "how to "

thanks in advance..
regards
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could append them as query string parameters.
Alternatively, you could store them in session and read them back from the next JSP.
Another alternative would be to bind them to request scope and forward (using a request dispatcher) to the next page. They could then be read from request scope from the next page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!