This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming 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
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Call servlet from Struts Action Class

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I have two web applications.One is written using struts and another is written using servlets.I want to call servlet from struts action class.Both are present in different web applications.
In simple words i want to achieve communication between two web applications.Is it possible??

Please help me

Regards,
Surya
 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can issue an HTTP request under code control. There are a number of ways to do this but one of the easiest is with a project named HttpClient.

As this is not really a Struts question, I've moved it to a more appropriate location.
 
Surya Kant
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear,
Can you elaborate more on how HTTPClient will help me in forwarding request to servlet which is sitting in some other web application of same servlet container?Struts does not provide any solution for this?

Regards,
Surya
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HTTPClient is used to make web requests. "Calling" another web application from *within* a web application generally requires doing your own communication. If you're just making a request from the client (browser) side to the other application you don't have to do anything.
 
Surya Kant
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thanks for the reply,
Yes i know if call is from client to server i can do it very easily.I dont have to do anything.But my problem is i want to forward the request from one web application to another web application.Is it possible??

Regards,
Surya
 
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!