• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Get ServletContext of a web app hosted in another server

 
Saiprasad Natarajan
Greenhorn
Posts: 12
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajani Gummadi,
Your post was moved to a new topic.
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Saiprasad Natarajan
Greenhorn
Posts: 12
Eclipse IDE Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic