Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
    Bookmark Topic Watch Topic
  • New Topic

Communication between servlets of two different applications in Tomcat  RSS feed

Matt Thomassan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 66141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!