• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

response.sendRedirect()  RSS feed

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);
int i=0;
{String unameser = rs.getString(1);
{response.sendRedirect("validate_new_user.jsp?<%=fname=fname"%> ;

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..
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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!