• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

response.sendRedirect()

 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic