• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sendRedirect(" ");

 
Arun Vethadas .T
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai
i have one problem. IN my servlet one if condition where i using response.sendRedirect("filepath");it ask for full path like("http://3.50.20.12:8080/six/page3.jsp")
when i give response.sendRedirect("page3.jsp");
it is not working. i don't know why?
pls . help me.
Thanks,
Arun.
 
Bosun Bello
Ranch Hand
Posts: 1510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
instead of send redirect whic send a response back to the client, you want to use the forward or include method of the RequestDispatcher object. Search this forum for those keywords.
 
Vikas Aggarwal
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
When you use sendRedirect() or forward() they expect to have the relative virual URL. If the first page and the coming page are have the same virtual dirctory , you don't need to give the full path. But if they don't then you need to give path like "http://3.50.20.12:8080/six/page3.jsp".
Please do check that the first page from which "Page3.jsp" is being refernced is under the path "http://3.50.20.12:8080/six/".
 
Arun Vethadas .T
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u verymuch
Arun.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic