aspose file tools*
The moose likes Servlets and the fly likes req to diferent servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "req to diferent servlet" Watch "req to diferent servlet" New topic
Author

req to diferent servlet

sampath ramanujan
Greenhorn

Joined: Jul 15, 2001
Posts: 16
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

Joined: Nov 06, 2000
Posts: 1510
Yes.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
(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.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
sampath ramanujan
Greenhorn

Joined: Jul 15, 2001
Posts: 16
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

Joined: Mar 06, 2001
Posts: 13459

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: req to diferent servlet