[Logo]
Forums Register Login
response.sendRedirect()
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
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.
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


This thread has been viewed 591 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 19, 2018 11:41:13.