wood burning stoves 2.0*
The moose likes Servlets and the fly likes Different ContextRoot ..?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Different ContextRoot ..??" Watch "Different ContextRoot ..??" New topic
Author

Different ContextRoot ..??

Karan V Praba
Ranch Hand

Joined: Oct 31, 2002
Posts: 41
Hi All,
I have to access the servlet in the other context root in different server(not in the same Server/Container).Is it possible..?
Please give me an idea to solve this issue.
Thnaks in advance.


Karan V Praba.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

If it is running in the same cluster, you may still be able to use getServletContext().getContext("name of other context") to get a reference to the Servlet, but you may also need to enable this in security settings.... somewhere. (Sorry, I've done it, but I'm drawing a blank)
I'm not sure it's ever worth the effort though, and it's easier to just include the servlet code in your application.
Dave
[ December 15, 2003: Message edited by: David O'Meara ]
Mani Narain
Greenhorn

Joined: Dec 14, 2003
Posts: 4
If you want to access a servlet which is in a different sever,u could use sendRedirect() method...
Karan V Praba
Ranch Hand

Joined: Oct 31, 2002
Posts: 41
Hi,
I don't want to use redirect method since all my response has to go from my first servlet.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Different ContextRoot ..??