This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to tranfer request parameter to another application on the same server  RSS feed

 
Mike Anna
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I have two questions :
1) How can I transfer the request parameters to another application on the same server/container ? ( is it possible at all ?)
2) I know for sure this is not possible using only the req/res objects but still, is there a way I can tranfer my request/response parameters to another application on another servlet , without using hidden parameters ?

Please let me know

Rgds
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A few workarounds come to mind.

In some containers it is possible to obtain a RequestDispatcher for a resource in a different web app. That generally needs to be enabled especially; e.g. Tomcat uses the crossContext setting to do that.

Another way -with a number of drawbacks- would be to perform a client-side redirect to a URL that has all the parameters included as GET parameters.

If you have an Apache in front of your servlet container -and know that the request needs to be sent elsewhere before looking at it- then that's what the mod_rewrite module is for.
 
Mike Anna
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got you.
Thanks Ulf Dittmer. That pretty much explains my 1 question. Thanks a ton. I know I could never have gotten to it.

I am assuming, that for the question 2. There is infact no other way around other than having a GET method populated with the values/params. Right ?
So all in all, if the other applications servlet takes only a post call. I cannot really transfer any variable to "that" application(servlet). Is my understanding correct ?

Rgds
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if the other applications servlet takes only a post call. I cannot really transfer any variable to "that" application(servlet). Is my understanding correct ?

Yes.
 
Mike Anna
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks. This forum rocks !!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!