Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • 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
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

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
 
Author and ninkuma
Marshal
Posts: 66819
168
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
Posts: 66819
168
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 .
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!