• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

servlet sendRedirect()

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to pass arguments to a new page by placing the url in the sendRedirect method. It doesn't throw an error but just stops. What do you think could be wrong? The url is correct but it doesn't even get to the doGet()! The url works if I type it into the browser manually. Thanks for any help!
 
jodi blair
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could somebody reply to this? Is it just a dumb or confusing question? I just need some suggestions as to what could be wrong! Thanks
 
jodi blair
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I figured it out -- I accidentally had debug statements using a connection object, not good! Take 'em out and it works.
 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why? I think you still need the connection object?
 
jodi blair
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was talking about the output stream. i was using it to print out debug statements. Once it is at the browser(printing the debug statements), you can't redirect. By connection object, i meant a custom made-connection object, and I meant take the debug statements out -- sorry to confuse
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When you use sendRedirect in Servlet your response and Request are not carried forward to next page .
Use RequestDispatcher ..
ServletContext sc = getServletContext();
RequestDispatcher rd = sc.getRequestDispatche("URL");
rd.forward(req,res);

 
reply
    Bookmark Topic Watch Topic
  • New Topic