Meaningless Drivel is fun!*
The moose likes Tomcat and the fly likes Communication between servlets of two different applications in Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Reply locked New topic
Author

Communication between servlets of two different applications in Tomcat

Matt Thomassan
Ranch Hand

Joined: Dec 23, 2008
Posts: 44
Hi Ranchers,

I had initially posted this doubt in Servlet's forum. I learned this is the more appropriate place for the question.

I have a question regarding invoking a resource from other application in Tomcat.

Consider, there are 2 web applications viz., WebApplication1 and WebApplication2.

WebApplication1 has Servlet1 and WebApplication2 has Servlet2.

How can we forward the request to Servlet2 (in WebApplication2) from Servlet1 (in WebApplication1).

In Servlet1 we can write,



I think we have to play with ServletContext. Somehow we have to get the ServletContext of WebApplication2 in WebApplication1.

All the servlets in the web application have reference to the Servlet Context.

Does Tomcat maintain "something" as a reference to all the Servlet Contexts?

Any ideas are welcome.

Thanks for your time and consideration.

Best Regards
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

Please don't post the same question in two places. Ask a staffer to move the original.

I have taken care of that for you.

It would have been fine had you pointed out that you are looking for cross-context dispatching, but you just re-posted the same general question.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Don't get me started about those stupid light bulbs.
 
subject: Communication between servlets of two different applications in Tomcat
 
Similar Threads
Communication between servlets of two different applications
Servlets Scenario Question
Don't understand defining roles in HFJS book
HFSJ Chapter 6 - Mock exam Question 7
requestdispatch - servlet to servlet in iplanet( anyone plzzzzzzz!!!!)