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

req to diferent servlet

 
sampath ramanujan
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I have one Request in the Servlet, Is it possible to redirect that request to the different servlet which is not running in my server/context.
Please advise me.
Urgent
Regards
Sampath Ramanujan
 
Bosun Bello
Ranch Hand
Posts: 1510
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(Bosun, that was mean )
You can redirect to any URL if you use the HttpResponse.sendRedirect("some_url") method.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
 
sampath ramanujan
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
sendDirect does not allow me to redirect to the servlet which is running in another Server. It allows only the servlet running in the current root Context. Same thing happening in forward also.
I want to redirect to another servlet which is running in anoterh server [ for eg http://mysite.com:8100/servlet/AdminServlet ]
Originally posted by Kyle Brown:
(Bosun, that was mean )
You can redirect to any URL if you use the HttpResponse.sendRedirect("some_url") method.
Kyle

 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, Kyle is correct.
RequestDispatcher.forward() and .include() must be to the same application context, response.sendRedirect() can be made to a remote system and can pass parameters

Dave
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic