File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Get ServletContext of a web app hosted in another server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "Get ServletContext of a web app hosted in another server" Watch "Get ServletContext of a web app hosted in another server" New topic
Author

Get ServletContext of a web app hosted in another server

Saiprasad Natarajan
Greenhorn

Joined: Oct 27, 2010
Posts: 12

Hi

Is there anyway i can get the servletcontext of a web app in a server not the same as the one in which the current app is hosted?

For Ex,

WEBAPP A is in WEBSERVER B, and WEBAPP C is in WEBSERVER D.

I need to get the context of WEBAPP C in WEBAPP A.

getServlet().getServletContext().getContext("WEBAPP C") would have got it if WEBAPP C was in server B.

Is there anyway i can set the server to look in first and then get the context after that?

TIA
Sai
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

No.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61310
    
  66

Rajani Gummadi,
Your post was moved to a new topic.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Is there anyway i can get the servletcontext of a web app in a server not the same as the one in which the current app is hosted?


Could you let us , why are you attempting for such a thing ?? so taht we can help you achive your requirement . Thnaks .


Save India From Corruption - Anna Hazare.
Saiprasad Natarajan
Greenhorn

Joined: Oct 27, 2010
Posts: 12

Could you let us , why are you attempting for such a thing ?? so taht we can help you achive your requirement . Thnaks


There is an application on Server1 and another application on Server2. The application starts off from Server1 and in the interim, i need to process some info in Server2 and then back. To process this info, i need the request object from Server1's application.
These 2 apps being on different servers, how do i maintain a session between them?

Passing the required data to server2 through query parameters is not an option since there are too many of them.

I am in the process of trying the HttpProxyServlet (weblogic) but i am not sure if RequestDispatcher can forward requests to app in other servers.

I read something about Coherence in this forum, not sure if that worked for someone?

Thanks
Sai
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

Basically for this requirement you need to consider using HttpClient for achiving this .This is a sample program , here as you can see i am passing Object to different server .


Thanks .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Get ServletContext of a web app hosted in another server