• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Get ServletContext of a web app hosted in another server  RSS feed

 
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
 
Marshal
Posts: 67225
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
 
Bear Bibeault
Marshal
Posts: 67225
169
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.
 
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 .
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!