• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sendredirect is not working

 
sriinu reddy
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

resp.setContentType("text/html");
PrintWriter out = resp.getWriter();

//RequestDispatcher rd=req.getRequestDispatcher("error.jsp"); out.println("hello");
resp.sendRedirect("http://localhost:8080/servletexample/error.jsp");
out.println("hello");

the above code is not working it says " the server is redirecting the request for this address in a way that will never complete." rendered in the browser
please help me.
 
Saif Asif
Ranch Hand
Posts: 440
Eclipse IDE Hibernate Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I can see that you are redirecting it and giving an absolute path to the error page. Is the error.jsp deployed in another application ? If not then use relative paths.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic