Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to send request from one applicaton to another webapplication  RSS feed

 
santosh mudholam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have to send a request with post parameters from one web application to another web application,both are running different servers.
In my application i don't have any JSP,html only controller part which will handle request extract request parameters & based on request params i'll do a web service call.
My current requirement is based on request parameters i'll send request to another web application with received parameters.

I tried with sendRedirect() ,but it support only get() method.

Please suggest me how to proceed further.

Thank you all.
Santosh
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "send request" - a redirect? If so, as you discovered, that only supports GET.

Which of the servers should generate the reply - the one receiving the request, or he one to which you want to "redirect" to? The server receiving the request could act as a proxy, making an HTTP call to the other server, and then generating an HTTP response base don that.

Or you can put an Apache httpd with mod_rewrite in front of both servers, to have it intercept the request, and forward it to the appropriate server.
 
santosh mudholam
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

Thanks for reply,using senRedirect() of Servlet i can forward my request to other web application,but this method will support servlet get() method where request parameters are Query string.
My requirement is using post parameters i need to send .
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that just repeats what you said before. So:
Ulf Dittmer wrote:Which of the servers should generate the reply - the one receiving the request, or he one to which you want to "redirect" to?


Would either of the proxy or mod_rewrite approaches I mentioned work?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!