File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet sendRedirect()

 
jodi blair
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Zoe Peng
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why? I think you still need the connection object?
 
jodi blair
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
sujit kolte
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • 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);

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic